Add the option to disable languages managment to cover special cases

We understand languages management as the ability to add new languages
or remove existing ones. When no option is passed it will allow language
manipulation by default.

There are 3 special places where we want block languages management:
- admin legislation processes homepage
- admin legislation processes milestones summary
- proposals retired form

Co-Authored-By: Sebastia <sebastia.roig@gmail.com>
This commit is contained in:
Senén Rodero Rodríguez
2019-06-03 12:49:17 +02:00
parent 0602a38742
commit b2d8851bcc
9 changed files with 45 additions and 11 deletions

View File

@@ -282,4 +282,25 @@ describe "Admin collaborative legislation" do
expect(page).to have_content "There is still a long journey ahead of us"
end
end
context "Special interface translation behaviour" do
let!(:process) { create(:legislation_process) }
before { Setting["feature.translation_interface"] = true }
after { Setting["feature.translation_interface"] = nil }
scenario "Cant manage translations on homepage form" do
visit edit_admin_legislation_process_homepage_path(process)
expect(page).not_to have_css "#add_language"
expect(page).not_to have_link "Remove language"
end
scenario "Cant manage translations on milestones summary form" do
visit admin_legislation_process_milestones_path(process)
expect(page).not_to have_css "#add_language"
expect(page).not_to have_link "Remove language"
end
end
end