Files
nairobi/spec/system/management/localization_spec.rb
Javi Martín ff0f2215ea Extract component for locale switcher
Note that in order to simplify the component tests (which for some
reason seem to be whitespace-sensitive), we have to omit whitespace
characters inside the `<option>` tags.

Also note we're simplifying the test with a missing language name; since
a component test doesn't involve a whole request, we don't need a
complex setup (I'm not sure we even need it in system tests).
2021-07-05 22:27:39 +02:00

21 lines
509 B
Ruby

require "rails_helper"
describe "Localization" do
scenario "Wrong locale" do
login_as_manager
visit management_root_path(locale: :es)
visit management_root_path(locale: :klingon)
expect(page).to have_text("Gestión")
end
scenario "Changing the locale" do
login_as_manager
select "Español", from: "Language:"
expect(page).not_to have_select "Language:"
expect(page).to have_select "Idioma:", selected: "Español"
expect(page).to have_content "Gestión"
end
end