mock['info']['username'] = username unless username.nil?
mock['info']['identity_url'] = identity_url unless identity_url.nil?
post('/auth/josh_id/callback',
- {return_to: client_url(remote: remote)},
- {'omniauth.auth' => mock})
+ params: {return_to: client_url(remote: remote)},
+ headers: {'omniauth.auth' => mock})
errors = {
:redirect => 'Did not redirect to client with token',
test 'existing user login' do
mock_auth_with(identity_url: "https://active-user.openid.local")
u = assigns(:user)
- assert_equal 'zzzzz-tpzed-xurymjxw79nv3jz', u.uuid
+ assert_equal users(:active).uuid, u.uuid
end
test 'user redirect_to_user_uuid' do
mock_auth_with(identity_url: "https://redirects-to-active-user.openid.local")
u = assigns(:user)
- assert_equal 'zzzzz-tpzed-xurymjxw79nv3jz', u.uuid
+ assert_equal users(:active).uuid, u.uuid
end
test 'user double redirect_to_user_uuid' do
mock_auth_with(identity_url: "https://double-redirects-to-active-user.openid.local")
u = assigns(:user)
- assert_equal 'zzzzz-tpzed-xurymjxw79nv3jz', u.uuid
+ assert_equal users(:active).uuid, u.uuid
end
test 'create new user during omniauth callback' do
].each do |testcase|
test "user auto-activate #{testcase.inspect}" do
# Configure auto_setup behavior according to testcase[:cfg]
- Rails.configuration.auto_setup_new_users = testcase[:cfg][:auto]
- Rails.configuration.auto_setup_new_users_with_vm_uuid =
- (testcase[:cfg][:vm] ? virtual_machines(:testvm).uuid : false)
- Rails.configuration.auto_setup_new_users_with_repository =
+ Rails.configuration.Users.NewUsersAreActive = false
+ Rails.configuration.Users.AutoSetupNewUsers = testcase[:cfg][:auto]
+ Rails.configuration.Users.AutoSetupNewUsersWithVmUUID =
+ (testcase[:cfg][:vm] ? virtual_machines(:testvm).uuid : "")
+ Rails.configuration.Users.AutoSetupNewUsersWithRepository =
testcase[:cfg][:repo]
mock_auth_with(email: testcase[:email])