Use labels in language selector tests
This way the test verifies there's a label associated to that form field.
This commit is contained in:
@@ -12,26 +12,21 @@ describe "Localization" do
|
||||
scenario "Available locales appear in the locale switcher" do
|
||||
login_as_manager
|
||||
|
||||
within(".locale-form .js-location-changer") do
|
||||
expect(page).to have_content "Español"
|
||||
expect(page).to have_content "English"
|
||||
end
|
||||
expect(page).to have_select "Language:", with_options: %w[Español English]
|
||||
end
|
||||
|
||||
scenario "The current locale is selected" do
|
||||
login_as_manager
|
||||
expect(page).to have_select("locale-switcher", selected: "English")
|
||||
expect(page).to have_select "Language:", selected: "English"
|
||||
expect(page).to have_text("Management")
|
||||
end
|
||||
|
||||
scenario "Changing the locale" do
|
||||
login_as_manager
|
||||
expect(page).to have_content("Language")
|
||||
select "Español", from: "Language:"
|
||||
|
||||
select("Español", from: "locale-switcher")
|
||||
expect(page).to have_content("Idioma")
|
||||
expect(page).not_to have_content("Language")
|
||||
expect(page).to have_select("locale-switcher", selected: "Español")
|
||||
expect(page).not_to have_select "Language:"
|
||||
expect(page).to have_select "Idioma:", selected: "Español"
|
||||
end
|
||||
|
||||
scenario "Locale switcher not present if only one locale" do
|
||||
|
||||
Reference in New Issue
Block a user