Fix crash updating legislation process categories
We were expecting translation parameters in legislation processes `update` action. However, those parameters aren't sent when we get to that action through the "proposals" tab.
This commit is contained in:
@@ -8,6 +8,8 @@ module Translatable
|
|||||||
private
|
private
|
||||||
|
|
||||||
def translation_params(resource_model)
|
def translation_params(resource_model)
|
||||||
|
return [] unless params[:enabled_translations]
|
||||||
|
|
||||||
resource_model.translated_attribute_names.product(enabled_translations).map do |attr_name, loc|
|
resource_model.translated_attribute_names.product(enabled_translations).map do |attr_name, loc|
|
||||||
resource_model.localized_attr_name_for(attr_name, loc)
|
resource_model.localized_attr_name_for(attr_name, loc)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -130,5 +130,16 @@ feature 'Admin legislation processes' do
|
|||||||
|
|
||||||
expect(page).not_to have_content 'Draft publication'
|
expect(page).not_to have_content 'Draft publication'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Change proposal categories" do
|
||||||
|
visit edit_admin_legislation_process_path(process)
|
||||||
|
within(".admin-content") { click_link "Proposals" }
|
||||||
|
|
||||||
|
fill_in "Categories", with: "recycling,bicycles"
|
||||||
|
click_button "Save changes"
|
||||||
|
|
||||||
|
visit admin_legislation_process_proposals_path(process)
|
||||||
|
expect(page).to have_field("Categories", with: "bicycles, recycling")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user