Merge pull request #3868 from andrewcameronsims/legislation_categories_persist
Fix categories being removed when a legislation process is changed
This commit is contained in:
@@ -24,8 +24,6 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
|
||||
|
||||
def update
|
||||
if @process.update(process_params)
|
||||
set_tag_list
|
||||
|
||||
link = legislation_process_path(@process)
|
||||
redirect_back(fallback_location: (request.referer || root_path),
|
||||
notice: t("admin.legislation.processes.update.notice", link: link))
|
||||
@@ -77,11 +75,6 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
|
||||
]
|
||||
end
|
||||
|
||||
def set_tag_list
|
||||
@process.set_tag_list_on(:customs, process_params[:custom_list])
|
||||
@process.save!
|
||||
end
|
||||
|
||||
def resource
|
||||
@process || ::Legislation::Process.find(params[:id])
|
||||
end
|
||||
|
||||
@@ -249,6 +249,13 @@ describe "Admin collaborative legislation" do
|
||||
|
||||
visit admin_legislation_process_proposals_path(process)
|
||||
expect(page).to have_field("Categories", with: "bicycles, recycling")
|
||||
|
||||
within(".admin-content") { click_link "Information" }
|
||||
fill_in "Summary", with: "Summarizing the process"
|
||||
click_button "Save changes"
|
||||
|
||||
visit admin_legislation_process_proposals_path(process)
|
||||
expect(page).to have_field("Categories", with: "bicycles, recycling")
|
||||
end
|
||||
|
||||
scenario "Edit milestones summary", :js do
|
||||
|
||||
Reference in New Issue
Block a user