-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating user registration list (#1293)
updating spec for registration list
- Loading branch information
Showing
6 changed files
with
19 additions
and
9 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
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 |
---|---|---|
|
@@ -87,26 +87,26 @@ | |
it "creates a new user for every line in the file" do | ||
expect(User.count).to eq 0 | ||
User.load_registration_list | ||
expect(User.count).to eq 107 | ||
expect(User.count).to eq 109 | ||
end | ||
it "does not create a user if they exist already" do | ||
User.create(uid: "mjc12", family_name: "Chandler", display_name: "Matt Chandler", email: "[email protected]") | ||
expect(User.count).to eq 1 | ||
User.load_registration_list | ||
expect(User.count).to eq 107 | ||
expect(User.count).to eq 109 | ||
user = User.find_by(uid: "mjc12") | ||
# If we don't say that this is a cas user, they won't be able to log in with CAS | ||
expect(user.provider).to eq "cas" | ||
end | ||
it "updates a name if the name is updated in the spreadsheet" do | ||
User.load_registration_list | ||
expect(User.count).to eq 107 | ||
expect(User.count).to eq 109 | ||
blank_name_user = User.find_by(uid: "munan") | ||
expect(blank_name_user.family_name).to be_nil | ||
expect(blank_name_user.display_name).to be_nil | ||
allow(User).to receive(:csv_data).and_return(updated_csv_data) | ||
User.load_registration_list | ||
expect(User.count).to eq 107 | ||
expect(User.count).to eq 109 | ||
updated_name_user = User.find_by(uid: "munan") | ||
expect(updated_name_user.family_name).to eq "Nøme" | ||
expect(updated_name_user.display_name).to eq "Fáké Nøme" | ||
|