forked from DMPRoadmap/roadmap
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #907 from portagenetwork/aaron/issues/sso-link
Update Handling of SSO Linking
- Loading branch information
Showing
4 changed files
with
33 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,19 @@ | |
expect(page).to have_content('John Doe') | ||
end | ||
|
||
it 'links account from external credentails' do | ||
it 'does not create SSO link when user is signed out and SSO email is an existing account email' do | ||
# Hardcode user email to what we are mocking via OmniAuth.config.mock_auth[:openid_connect] | ||
user = create(:user, :org_admin, org: @org, email: '[email protected]', firstname: 'DMP Name', | ||
surname: 'DMP Lastname') | ||
expect(user.identifiers.count).to eql(0) | ||
visit root_path | ||
click_link 'Sign in with CILogon' | ||
error_message = 'That email appears to be associated with an existing account' | ||
expect(page).to have_content(error_message) | ||
expect(user.identifiers.count).to eql(0) | ||
end | ||
|
||
xit 'links account from external credentails' do | ||
# Create existing user | ||
user = create(:user, :org_admin, org: @org, email: '[email protected]', firstname: 'DMP Name', | ||
surname: 'DMP Lastname') | ||
|