forked from expertiza/expertiza
-
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.
- Loading branch information
Showing
8 changed files
with
26 additions
and
26 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 |
---|---|---|
|
@@ -47,7 +47,7 @@ | |
allow(AssignmentParticipant).to receive(:find).with('1').and_return(participant) | ||
allow(Assignment).to receive(:find).with(1).and_return(assignment) | ||
request_params = { | ||
user: { username: '[email protected]', email: '[email protected]' }, | ||
user: { name: '[email protected]', email: '[email protected]' }, | ||
student_id: 1 | ||
} | ||
user_session = { user: student } | ||
|
@@ -103,7 +103,7 @@ | |
allow(Team).to receive(:find).with('1').and_return(team) | ||
user_session = { user: student1 } | ||
expect { post :create, params: request_params, session: user_session }.to change(Invitation, :count).by(0).and change(User, :count).by(0) | ||
expect(flash[:error]).to eq 'The user "[email protected]" does not exist. Please make sure the name entered is correct.' | ||
expect(flash[:error]).to eq 'The user "[email protected]" does not exist. Please make sure the username entered is correct.' | ||
end | ||
end | ||
describe '#create' do | ||
|
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
'other_param' => 'value' | ||
} | ||
end | ||
let(:user) { User.create(name: 'testuser', email: '[email protected]') } | ||
let(:user) { User.create(username: 'testuser', email: '[email protected]') } | ||
let(:shared_secret) { 'shared_secret' } | ||
|
||
before do | ||
|
@@ -140,10 +140,10 @@ | |
|
||
describe '#authenticate_and_login_user' do | ||
context 'when user exists' do | ||
let(:user) { User.create(name: 'testuser', email: '[email protected]') } | ||
let(:user) { User.create(username: 'testuser', email: '[email protected]') } | ||
|
||
before do | ||
allow(User).to receive(:find_by).with(name: 'testuser').and_return(user) | ||
allow(User).to receive(:find_by).with(username: 'testuser').and_return(user) | ||
allow(controller).to receive(:redirect_to) | ||
allow(controller).to receive(:session).and_return({}) | ||
allow(AuthController).to receive(:set_current_role) | ||
|
@@ -159,7 +159,7 @@ | |
|
||
context 'when user does not exist' do | ||
before do | ||
allow(User).to receive(:find_by).with(name: 'testuser').and_return(nil) | ||
allow(User).to receive(:find_by).with(username: 'testuser').and_return(nil) | ||
allow(controller).to receive(:redirect_to) | ||
end | ||
|
||
|
@@ -171,7 +171,7 @@ | |
|
||
context 'when an error occurs' do | ||
before do | ||
allow(User).to receive(:find_by).with(name: 'testuser').and_raise(StandardError.new('Test error')) | ||
allow(User).to receive(:find_by).with(username: 'testuser').and_raise(StandardError.new('Test error')) | ||
allow(controller).to receive(:redirect_to) | ||
allow(Rails.logger).to receive(:error) | ||
end | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
@user = User.new | ||
@user.email = '[email protected]' | ||
@user.fullname = 'John Bumgardner' | ||
@user.username = 'ex' | ||
@user.username = 'exe' | ||
@user.save! | ||
request_params = { user: { email: '[email protected]' } } | ||
post :send_password, params: request_params | ||
|
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 |
---|---|---|
|
@@ -123,7 +123,7 @@ | |
describe '#reviewer_details_popup' do | ||
it 'render reviewer_details_popup page successfully' do | ||
participant = double(:participant, user_id: 1) | ||
user = double(:user, fullname: 'Test User', name: 'Test', email: '[email protected]', handle: 1) | ||
user = double(:user, fullname: 'Test User', username: 'Test', email: '[email protected]', handle: 1) | ||
allow(Participant).to receive(:find).with('1').and_return(participant) | ||
allow(User).to receive(:find).with(participant.user_id).and_return(user) | ||
request_params = { id: 1, assignment_id: 1 } | ||
|
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