Change mock accounts credentials
The names and usernames don't follow a canonical pattern And the emails point to a valid domain not owned by osem and not reserved for illustration purposes Normalize the users' names and usernames and change the domain of the email addresses to example.com Fix #1365
This commit is contained in:
parent
5be1ad52ee
commit
9341edd9cb
3 changed files with 29 additions and 29 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue