mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Merge pull request #1879 from internetee/tara-key-fix
Fix CookieOverflow error using current Tara test keys
This commit is contained in:
commit
c521bc240e
3 changed files with 20 additions and 2 deletions
|
@ -34,6 +34,18 @@ class TaraUsersTest < ApplicationSystemTestCase
|
|||
assert_text('Signed in successfully')
|
||||
end
|
||||
|
||||
def test_existing_user_logs_in_without_cookie_overflow
|
||||
@existing_user_hash['credentials'] = massive_hash
|
||||
OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@existing_user_hash)
|
||||
|
||||
visit new_registrar_user_session_path
|
||||
assert_nothing_raised do
|
||||
click_link('Sign in')
|
||||
end
|
||||
|
||||
assert_text('Signed in successfully')
|
||||
end
|
||||
|
||||
def test_nonexisting_user_gets_error_message
|
||||
OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@new_user_hash)
|
||||
|
||||
|
@ -42,4 +54,10 @@ class TaraUsersTest < ApplicationSystemTestCase
|
|||
|
||||
assert_text('No such user')
|
||||
end
|
||||
|
||||
def massive_hash
|
||||
o = [('a'..'z'), ('A'..'Z')].map(&:to_a).flatten
|
||||
string = (0...5000).map { o[rand(o.length)] }.join
|
||||
{"access_token":"AT-540-Fj5gbPvJp4jPkO-4EdgzIhIhhJapoRTM","token_type":"bearer","expires_in":600,"id_token":string}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue