summaryrefslogtreecommitdiff
path: root/test/integration/browser/account_livecycle_test.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2017-10-16 13:56:48 +0000
committerazul <azul@riseup.net>2017-10-16 13:56:48 +0000
commit3657d09bf7993bb5ac3393e3c5d8c7fb8cae0844 (patch)
treeb903a3f85193675596a611e396a3c0322d4b0302 /test/integration/browser/account_livecycle_test.rb
parent35b710c968d6e71e4d4210dbc2e00abc6f14f513 (diff)
parentaba11e35fa483ae72203854e323445e8330ed71b (diff)
Merge branch 'bugfix/8805-failed-login-with-locale' into 'master'
fix: login error message with locale set Closes #8805 See merge request leap/webapp!46
Diffstat (limited to 'test/integration/browser/account_livecycle_test.rb')
-rw-r--r--test/integration/browser/account_livecycle_test.rb15
1 files changed, 13 insertions, 2 deletions
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