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).
21 lines
509 B
Ruby
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
|