mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
remove spaces inside {} of test/integration/twofa_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20460 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9ae922f698
commit
1974d79a2a
@ -40,7 +40,7 @@ class TwofaTest < Redmine::IntegrationTest
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
||||||
totp = ROTP::TOTP.new User.find_by_login('jsmith').twofa_totp_key
|
totp = ROTP::TOTP.new User.find_by_login('jsmith').twofa_totp_key
|
||||||
post "/my/twofa/totp/activate", params: { twofa_code: totp.now }
|
post "/my/twofa/totp/activate", params: {twofa_code: totp.now}
|
||||||
assert_redirected_to "/my/account"
|
assert_redirected_to "/my/account"
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
assert_response :success
|
assert_response :success
|
||||||
@ -52,7 +52,7 @@ class TwofaTest < Redmine::IntegrationTest
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select 'form', /Please enter your two-factor authentication code/i
|
assert_select 'form', /Please enter your two-factor authentication code/i
|
||||||
|
|
||||||
post "/my/twofa/backup_codes/create", params: { twofa_code: "wrong" }
|
post "/my/twofa/backup_codes/create", params: {twofa_code: "wrong"}
|
||||||
assert_redirected_to "/my/twofa/backup_codes/confirm"
|
assert_redirected_to "/my/twofa/backup_codes/confirm"
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
assert_response :success
|
assert_response :success
|
||||||
@ -61,7 +61,7 @@ class TwofaTest < Redmine::IntegrationTest
|
|||||||
# prevent replay attack prevention from kicking in
|
# prevent replay attack prevention from kicking in
|
||||||
User.find_by_login('jsmith').update_column :twofa_totp_last_used_at, 2.minutes.ago.to_i
|
User.find_by_login('jsmith').update_column :twofa_totp_last_used_at, 2.minutes.ago.to_i
|
||||||
|
|
||||||
post "/my/twofa/backup_codes/create", params: { twofa_code: totp.now }
|
post "/my/twofa/backup_codes/create", params: {twofa_code: totp.now}
|
||||||
assert_redirected_to "/my/twofa/backup_codes"
|
assert_redirected_to "/my/twofa/backup_codes"
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
assert_response :success
|
assert_response :success
|
||||||
@ -86,7 +86,7 @@ class TwofaTest < Redmine::IntegrationTest
|
|||||||
follow_redirect!
|
follow_redirect!
|
||||||
|
|
||||||
assert_select "#login-form h3", /two-factor authentication/i
|
assert_select "#login-form h3", /two-factor authentication/i
|
||||||
post "/account/twofa", params: { twofa_code: code }
|
post "/account/twofa", params: {twofa_code: code}
|
||||||
assert_redirected_to "/my/page"
|
assert_redirected_to "/my/page"
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
assert_response :success
|
assert_response :success
|
||||||
@ -103,11 +103,11 @@ class TwofaTest < Redmine::IntegrationTest
|
|||||||
assert key.present?
|
assert key.present?
|
||||||
totp = ROTP::TOTP.new key
|
totp = ROTP::TOTP.new key
|
||||||
|
|
||||||
post "/my/twofa/totp/activate", params: { twofa_code: '123456789' }
|
post "/my/twofa/totp/activate", params: {twofa_code: '123456789'}
|
||||||
assert_redirected_to "/my/twofa/totp/activate/confirm"
|
assert_redirected_to "/my/twofa/totp/activate/confirm"
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
|
|
||||||
post "/my/twofa/totp/activate", params: { twofa_code: totp.now }
|
post "/my/twofa/totp/activate", params: {twofa_code: totp.now}
|
||||||
assert_redirected_to "/my/account"
|
assert_redirected_to "/my/account"
|
||||||
|
|
||||||
post "/logout"
|
post "/logout"
|
||||||
@ -129,13 +129,13 @@ class TwofaTest < Redmine::IntegrationTest
|
|||||||
follow_redirect!
|
follow_redirect!
|
||||||
|
|
||||||
assert_select "#login-form h3", /two-factor authentication/i
|
assert_select "#login-form h3", /two-factor authentication/i
|
||||||
post "/account/twofa", params: { twofa_code: 'wrong code' }
|
post "/account/twofa", params: {twofa_code: 'wrong code'}
|
||||||
assert_redirected_to "/account/twofa/confirm"
|
assert_redirected_to "/account/twofa/confirm"
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
assert_select "#login-form h3", /two-factor authentication/i
|
assert_select "#login-form h3", /two-factor authentication/i
|
||||||
assert_select ".flash", /code is invalid/i
|
assert_select ".flash", /code is invalid/i
|
||||||
|
|
||||||
post "/account/twofa", params: { twofa_code: totp.now }
|
post "/account/twofa", params: {twofa_code: totp.now}
|
||||||
assert_redirected_to "/my/page"
|
assert_redirected_to "/my/page"
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user