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
|
def update
|
||||||
if @process.update(process_params)
|
if @process.update(process_params)
|
||||||
set_tag_list
|
|
||||||
|
|
||||||
link = legislation_process_path(@process)
|
link = legislation_process_path(@process)
|
||||||
redirect_back(fallback_location: (request.referer || root_path),
|
redirect_back(fallback_location: (request.referer || root_path),
|
||||||
notice: t("admin.legislation.processes.update.notice", link: link))
|
notice: t("admin.legislation.processes.update.notice", link: link))
|
||||||
@@ -77,11 +75,6 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
|
|||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_tag_list
|
|
||||||
@process.set_tag_list_on(:customs, process_params[:custom_list])
|
|
||||||
@process.save!
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource
|
def resource
|
||||||
@process || ::Legislation::Process.find(params[:id])
|
@process || ::Legislation::Process.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -249,6 +249,13 @@ describe "Admin collaborative legislation" do
|
|||||||
|
|
||||||
visit admin_legislation_process_proposals_path(process)
|
visit admin_legislation_process_proposals_path(process)
|
||||||
expect(page).to have_field("Categories", with: "bicycles, recycling")
|
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
|
end
|
||||||
|
|
||||||
scenario "Edit milestones summary", :js do
|
scenario "Edit milestones summary", :js do
|
||||||
|
|||||||
Reference in New Issue
Block a user