Adapt specs to new translations interface markup
This commit is contained in:
@@ -113,10 +113,10 @@ describe "Admin banners magement" do
|
|||||||
scenario "Publish a banner with a translation different than the current locale", :js do
|
scenario "Publish a banner with a translation different than the current locale", :js do
|
||||||
visit new_admin_banner_path
|
visit new_admin_banner_path
|
||||||
|
|
||||||
expect(page).to have_link "English"
|
expect_to_have_language_selected "English"
|
||||||
|
|
||||||
click_link "Remove language"
|
click_link "Remove language"
|
||||||
select "Français", from: "translation_locale"
|
select "Français", from: "add_language"
|
||||||
|
|
||||||
fill_in "Title", with: "En Français"
|
fill_in "Title", with: "En Français"
|
||||||
fill_in "Description", with: "Link en Français"
|
fill_in "Description", with: "Link en Français"
|
||||||
@@ -132,8 +132,7 @@ describe "Admin banners magement" do
|
|||||||
click_button "Save changes"
|
click_button "Save changes"
|
||||||
click_link "Edit banner"
|
click_link "Edit banner"
|
||||||
|
|
||||||
expect(page).to have_link "Français"
|
expect_to_have_language_selected "Français"
|
||||||
expect(page).not_to have_link "English"
|
|
||||||
expect(page).to have_field "Title", with: "En Français"
|
expect(page).to have_field "Title", with: "En Français"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ describe "Admin budget groups" do
|
|||||||
|
|
||||||
visit edit_admin_budget_group_path(budget, group)
|
visit edit_admin_budget_group_path(budget, group)
|
||||||
|
|
||||||
select "Español", from: "translation_locale"
|
select "Español", from: :add_language
|
||||||
fill_in "Group name", with: "Spanish name"
|
fill_in "Group name", with: "Spanish name"
|
||||||
click_button "Save group"
|
click_button "Save group"
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ describe "Admin budget groups" do
|
|||||||
|
|
||||||
visit edit_admin_budget_group_path(budget, group)
|
visit edit_admin_budget_group_path(budget, group)
|
||||||
|
|
||||||
click_link "English"
|
select "English", from: :select_language
|
||||||
fill_in "Group name", with: "New English Name"
|
fill_in "Group name", with: "New English Name"
|
||||||
click_button "Save group"
|
click_button "Save group"
|
||||||
|
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ describe "Admin budget headings" do
|
|||||||
|
|
||||||
visit edit_admin_budget_group_heading_path(budget, group, heading)
|
visit edit_admin_budget_group_heading_path(budget, group, heading)
|
||||||
|
|
||||||
select "Español", from: "translation_locale"
|
select "Español", from: :add_language
|
||||||
fill_in "Heading name", with: "Spanish name"
|
fill_in "Heading name", with: "Spanish name"
|
||||||
click_button "Save heading"
|
click_button "Save heading"
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ describe "Admin budget headings" do
|
|||||||
|
|
||||||
visit edit_admin_budget_group_heading_path(budget, group, heading)
|
visit edit_admin_budget_group_heading_path(budget, group, heading)
|
||||||
|
|
||||||
click_link "English"
|
select "English", from: :select_language
|
||||||
fill_in "Heading name", with: "New English Name"
|
fill_in "Heading name", with: "New English Name"
|
||||||
click_button "Save heading"
|
click_button "Save heading"
|
||||||
|
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ describe "Admin budgets" do
|
|||||||
|
|
||||||
visit edit_admin_budget_path(budget)
|
visit edit_admin_budget_path(budget)
|
||||||
|
|
||||||
select "Español", from: "translation_locale"
|
select "Español", from: :add_language
|
||||||
fill_in "Name", with: "Spanish name"
|
fill_in "Name", with: "Spanish name"
|
||||||
click_button "Update Budget"
|
click_button "Update Budget"
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ describe "Admin budgets" do
|
|||||||
|
|
||||||
visit edit_admin_budget_path(budget)
|
visit edit_admin_budget_path(budget)
|
||||||
|
|
||||||
click_link "English"
|
select "English", from: :select_language
|
||||||
fill_in "Name", with: "New English Name"
|
fill_in "Name", with: "New English Name"
|
||||||
click_button "Update Budget"
|
click_button "Update Budget"
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ describe "Admin legislation draft versions" do
|
|||||||
fill_in "Changes", with: "Version 3 changes"
|
fill_in "Changes", with: "Version 3 changes"
|
||||||
fill_in "Text", with: "Version 3 body"
|
fill_in "Text", with: "Version 3 body"
|
||||||
|
|
||||||
within(".end") do
|
within("form .end") do
|
||||||
click_button "Create version"
|
click_button "Create version"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ describe "Admin legislation questions" do
|
|||||||
|
|
||||||
find("#nested_question_options input").set("Option 1")
|
find("#nested_question_options input").set("Option 1")
|
||||||
|
|
||||||
click_link "Español"
|
select "Español", from: :select_language
|
||||||
|
|
||||||
find("#nested_question_options input").set("Opción 1")
|
find("#nested_question_options input").set("Opción 1")
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ describe "Admin legislation questions" do
|
|||||||
|
|
||||||
expect(page).to have_field(field_en[:id], with: "Option 1")
|
expect(page).to have_field(field_en[:id], with: "Option 1")
|
||||||
|
|
||||||
click_link "Español"
|
select "Español", from: :select_language
|
||||||
|
|
||||||
expect(page).to have_field(field_es[:id], with: "Opción 1")
|
expect(page).to have_field(field_es[:id], with: "Opción 1")
|
||||||
end
|
end
|
||||||
@@ -190,13 +190,13 @@ describe "Admin legislation questions" do
|
|||||||
scenario "Add new question option after changing active locale", :js do
|
scenario "Add new question option after changing active locale", :js do
|
||||||
visit edit_question_url
|
visit edit_question_url
|
||||||
|
|
||||||
click_link "Español"
|
select "Español", from: :select_language
|
||||||
|
|
||||||
click_on "Add option"
|
click_on "Add option"
|
||||||
|
|
||||||
find("#nested_question_options input").set("Opción 1")
|
find("#nested_question_options input").set("Opción 1")
|
||||||
|
|
||||||
click_link "English"
|
select "English", from: :select_language
|
||||||
|
|
||||||
find("#nested_question_options input").set("Option 1")
|
find("#nested_question_options input").set("Option 1")
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ describe "Admin legislation questions" do
|
|||||||
|
|
||||||
expect(page).to have_field(field_en[:id], with: "Option 1")
|
expect(page).to have_field(field_en[:id], with: "Option 1")
|
||||||
|
|
||||||
click_link "Español"
|
select "Español", from: :select_language
|
||||||
|
|
||||||
expect(page).to have_field(field_es[:id], with: "Opción 1")
|
expect(page).to have_field(field_es[:id], with: "Opción 1")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ describe "Admin custom information texts" do
|
|||||||
|
|
||||||
visit admin_site_customization_information_texts_path
|
visit admin_site_customization_information_texts_path
|
||||||
|
|
||||||
select "Français", from: "translation_locale"
|
select "Français", from: :add_language
|
||||||
fill_in "contents[content_#{key}]values[value_fr]", with: "Aide personalise sur les débats"
|
fill_in "contents[content_#{key}]values[value_fr]", with: "Aide personalise sur les débats"
|
||||||
|
|
||||||
click_button "Save"
|
click_button "Save"
|
||||||
@@ -76,8 +76,8 @@ describe "Admin custom information texts" do
|
|||||||
expect(page).to have_content "Translation updated successfully"
|
expect(page).to have_content "Translation updated successfully"
|
||||||
|
|
||||||
visit admin_site_customization_information_texts_path
|
visit admin_site_customization_information_texts_path
|
||||||
|
select "Français", from: :select_language
|
||||||
|
|
||||||
select "Français", from: "translation_locale"
|
|
||||||
expect(page).to have_content "Aide personalise sur les débats"
|
expect(page).to have_content "Aide personalise sur les débats"
|
||||||
expect(page).not_to have_content "Aide sur les débats"
|
expect(page).not_to have_content "Aide sur les débats"
|
||||||
end
|
end
|
||||||
@@ -87,14 +87,14 @@ describe "Admin custom information texts" do
|
|||||||
|
|
||||||
visit admin_site_customization_information_texts_path(tab: "proposals")
|
visit admin_site_customization_information_texts_path(tab: "proposals")
|
||||||
|
|
||||||
select "Français", from: "translation_locale"
|
select "Français", from: :select_language
|
||||||
fill_in "contents_content_#{key}values_value_fr", with: "Titre personalise de la proposition"
|
fill_in "contents_content_#{key}values_value_fr", with: "Titre personalise de la proposition"
|
||||||
|
|
||||||
click_button "Save"
|
click_button "Save"
|
||||||
expect(page).to have_content "Translation updated successfully"
|
expect(page).to have_content "Translation updated successfully"
|
||||||
|
|
||||||
visit admin_site_customization_information_texts_path(tab: "proposals")
|
visit admin_site_customization_information_texts_path(tab: "proposals")
|
||||||
click_link "Français"
|
select "Français", from: :select_language
|
||||||
|
|
||||||
expect(page).to have_content "Titre personalise de la proposition"
|
expect(page).to have_content "Titre personalise de la proposition"
|
||||||
expect(page).not_to have_content "Titre de la proposition"
|
expect(page).not_to have_content "Titre de la proposition"
|
||||||
@@ -113,14 +113,15 @@ describe "Admin custom information texts" do
|
|||||||
|
|
||||||
visit admin_site_customization_information_texts_path(tab: "debates")
|
visit admin_site_customization_information_texts_path(tab: "debates")
|
||||||
|
|
||||||
click_link "Español"
|
select "Español", from: :select_language
|
||||||
click_link "Remove language"
|
click_link "Remove language"
|
||||||
click_button "Save"
|
click_button "Save"
|
||||||
|
|
||||||
expect(page).not_to have_link "Español"
|
expect(page).not_to have_link "Español"
|
||||||
|
|
||||||
visit admin_site_customization_information_texts_path(tab: "debates")
|
visit admin_site_customization_information_texts_path(tab: "debates")
|
||||||
click_link "English"
|
select "English", from: :select_language
|
||||||
|
|
||||||
expect(page).to have_content "Start a new debate"
|
expect(page).to have_content "Start a new debate"
|
||||||
expect(page).to have_content "Custom debate title"
|
expect(page).to have_content "Custom debate title"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user