diff --git a/config/environments/development.rb b/config/environments/development.rb index 4c981699..2557e892 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -54,9 +54,9 @@ Osem::Application.configure do provider: 'facebook', uid: 'facebook-test-uid-1', info: { - name: 'admin admin', - email: 'admin@email.com', - username: 'admin_admin' + name: 'facebook user', + email: 'user-facebook@example.com', + username: 'user_facebook' }, credentials: { token: 'fb_mock_token', @@ -69,9 +69,9 @@ Osem::Application.configure do provider: 'google', uid: 'google-test-uid-1', info: { - name: 'simple user', - email: 'user0@email.com', - username: 'simple_user0' + name: 'google user', + email: 'user-google@example.com', + username: 'user_google' }, credentials: { token: 'google_mock_token', @@ -84,9 +84,9 @@ Osem::Application.configure do provider: 'suse', uid: 'suse-test-uid-1', info: { - name: 'another user', - email: 'user1@email.com', - username: 'another_user' + name: 'suse user', + email: 'user-suse@example.com', + username: 'user_suse' }, credentials: { token: 'suse_mock_token', @@ -99,9 +99,9 @@ Osem::Application.configure do provider: 'github', uid: 'github-test-uid-1', info: { - name: 'someother user', - email: 'user2@email.com', - username: 'someother_user' + name: 'github user', + email: 'user-github@example.com', + username: 'user_github' }, credentials: { token: 'github_mock_token', diff --git a/spec/features/omniauth_spec.rb b/spec/features/omniauth_spec.rb index 94949d58..6e05b06d 100644 --- a/spec/features/omniauth_spec.rb +++ b/spec/features/omniauth_spec.rb @@ -18,13 +18,13 @@ feature Openid do within('#openidlinks') do click_link 'omniauth-google' end - expect(flash).to eq('test-1@gmail.com signed in successfully with google') + expect(flash).to eq('test-1@example.com signed in successfully with google') expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) end scenario 'signs in an existing user' do - create(:user, email: 'test-participant-1@google.com') + create(:user, email: 'test-participant-1@example.com') expected_count_openid = Openid.count + 1 expected_count_user = User.count visit '/accounts/sign_in' @@ -33,7 +33,7 @@ feature Openid do within('#openidlinks') do click_link 'omniauth-google' end - expect(flash).to eq('test-participant-1@google.com signed in successfully with google') + expect(flash).to eq('test-participant-1@example.com signed in successfully with google') expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) end @@ -51,7 +51,7 @@ feature Openid do scenario 'adds openid to existing user' do # Sign in user - user = create(:user, email: 'test-participant-1@google.com') + user = create(:user, email: 'test-participant-1@example.com') sign_in user # Add openID to current user @@ -63,15 +63,15 @@ feature Openid do within('#openidlinks') do click_link 'omniauth-google' end - expect(flash).to eq('test-participant-1@google.com signed in successfully with google') + expect(flash).to eq('test-participant-1@example.com signed in successfully with google') expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) - expect(Openid.where(email: 'test-1@gmail.com').first.nil?).to eq(false) + expect(Openid.where(email: 'test-1@example.com').first.nil?).to eq(false) end scenario 'signs in with openID using the same email as another associated openid' do # Sign in user - create(:user, email: 'test-participant-1@google.com') + create(:user, email: 'test-participant-1@example.com') expected_count_openid = Openid.count + 1 expected_count_user = User.count visit '/accounts/sign_in' @@ -80,7 +80,7 @@ feature Openid do within('#openidlinks') do click_link 'omniauth-google' end - expect(flash).to eq('test-participant-1@google.com signed in successfully with google') + expect(flash).to eq('test-participant-1@example.com signed in successfully with google') expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) @@ -93,11 +93,11 @@ feature Openid do within('#openidlinks') do click_link 'omniauth-google' end - expect(flash).to eq('test-participant-1@google.com signed in successfully with google') + expect(flash).to eq('test-participant-1@example.com signed in successfully with google') expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) - expect(Openid.where(email: 'test-participant-1@google.com').first.nil?).to eq(false) - expect(Openid.where(email: 'test-1@gmail.com').first.nil?).to eq(false) + expect(Openid.where(email: 'test-participant-1@example.com').first.nil?).to eq(false) + expect(Openid.where(email: 'test-1@example.com').first.nil?).to eq(false) # Sign in with different openID using same email (test-1@gmail.com) sign_out @@ -109,12 +109,12 @@ feature Openid do within('#openidlinks') do click_link 'omniauth-facebook' end - expect(flash).to eq('test-participant-1@google.com signed in successfully with facebook') + expect(flash).to eq('test-participant-1@example.com signed in successfully with facebook') expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) last_openid = Openid.last expect(last_openid.uid).to eq('facebook-test-uid-1') - expect(last_openid.email).to eq('test-1@gmail.com') + expect(last_openid.email).to eq('test-1@example.com') end end diff --git a/spec/support/omniauth_macros.rb b/spec/support/omniauth_macros.rb index 76351686..1f81efe0 100644 --- a/spec/support/omniauth_macros.rb +++ b/spec/support/omniauth_macros.rb @@ -14,7 +14,7 @@ module OmniauthMacros uid: 'google-test-uid-1', info: { name: 'new user name', - email: 'test-1@gmail.com' + email: 'test-1@example.com' }, credentials: { token: 'mock_token', @@ -30,7 +30,7 @@ module OmniauthMacros uid: 'facebook-test-uid-1', info: { name: 'new user fb name', - email: 'test-1@gmail.com' + email: 'test-1@example.com' }, credentials: { token: 'mock_token', @@ -48,7 +48,7 @@ module OmniauthMacros uid: 'google-test-uid-participant-1', info: { name: 'existing user participant name', - email: 'test-participant-1@google.com' + email: 'test-participant-1@example.com' }, credentials: { token: 'mock_token', @@ -66,7 +66,7 @@ module OmniauthMacros uid: 'google-test-uid-admin-1', info: { name: 'existing user admin name', - email: 'test-admin-1@google.com' + email: 'test-admin-1@example.com' }, credentials: { token: 'mock_token',