[Enhancement] Add option to use existing Media Profile as template for new profile (#466)

* Add option to use existing Media Profile as template for new profile

* Forgot to commit the edit form too

* Reset deletion mark on Source controller

* Add test for new preload profile feature

* mix check
This commit is contained in:
Duong Nguyen
2024-11-20 13:25:53 -05:00
committed by GitHub
parent a02f71f304
commit 4c8c0461be
8 changed files with 37 additions and 6 deletions
@@ -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