summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--test/integration/browser/account_livecycle_test.rb15
2 files changed, 14 insertions, 3 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 1f37fea..d3cfc2b 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -99,7 +99,7 @@ class ApplicationController < ActionController::Base
#
# URL paths for which we don't enforce the locale as the prefix of the path.
#
- NON_LOCALE_PATHS = /^\/(assets|webfinger|.well-known|rails|key|[0-9]+)($|\/)/
+ NON_LOCALE_PATHS = /^\/(assets|webfinger|.well-known|rails|key|[0-9]+|new)($|\/)/
#
# For some requests, we ignore locale determination.
diff --git a/test/integration/browser/account_livecycle_test.rb b/test/integration/browser/account_livecycle_test.rb
index cfab444..68775d3 100644
--- a/test/integration/browser/account_livecycle_test.rb
+++ b/test/integration/browser/account_livecycle_test.rb
@@ -63,6 +63,16 @@ class AccountLivecycleTest < BrowserIntegrationTest
assert_invalid_login(page)
end
+ test "failed login with locale" do
+ page.driver.add_header 'Accept-Language', 'de'
+ visit '/'
+ click_on 'Anmelden'
+ fill_in 'Nutzername', with: 'username'
+ fill_in 'Password', with: 'falsches password'
+ click_on 'Session erstellen'
+ assert_invalid_login(page, locale: :de)
+ end
+
test "account destruction" do
username, password = submit_signup
@@ -115,9 +125,10 @@ class AccountLivecycleTest < BrowserIntegrationTest
click_on 'Log In'
end
- def assert_invalid_login(page)
+ def assert_invalid_login(page, locale: nil)
assert page.has_selector? '.btn-primary.disabled'
- assert page.has_content? sanitize(I18n.t(:invalid_user_pass), tags: [])
+ message = I18n.t :invalid_user_pass, locale: locale
+ assert page.has_content? sanitize(message, tags: [])
assert page.has_no_selector? '.btn-primary.disabled'
end