From 8750b76d63e0d0607bdd48a2586b892c5df9165f Mon Sep 17 00:00:00 2001 From: duong Date: Tue, 19 Nov 2024 19:02:42 +0000 Subject: [PATCH] Add test for new preload profile feature --- .../controllers/media_profile_controller_test.exs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/pinchflat_web/controllers/media_profile_controller_test.exs b/test/pinchflat_web/controllers/media_profile_controller_test.exs index 8c908de..2c3dcfc 100644 --- a/test/pinchflat_web/controllers/media_profile_controller_test.exs +++ b/test/pinchflat_web/controllers/media_profile_controller_test.exs @@ -79,6 +79,15 @@ defmodule PinchflatWeb.MediaProfileControllerTest do refute html_response(conn, 200) =~ "MENU" end + + test "preloads some attributes when using a template", %{conn: conn} do + profile = media_profile_fixture(name: "My first profile", download_subs: true, sub_langs: "de") + + conn = get(conn, ~p"/media_profiles/new", %{"template_id" => profile.id}) + assert html_response(conn, 200) =~ "New Media Profile" + assert html_response(conn, 200) =~ profile.sub_langs + refute html_response(conn, 200) =~ profile.name + end end describe "edit media_profile" do