Skip to content

Commit

Permalink
fix more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Manav Patel committed Oct 28, 2024
1 parent fe917a7 commit 0441b5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/controller_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def effective_permission_id
permission_id || controller.permission_id
end

def name
def fullname
if site_controller_id && (site_controller_id > 0)
"#{controller.name}: #{name}"
else
Expand Down
6 changes: 3 additions & 3 deletions spec/models/course_participant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
end

it 'raise error if record does not have enough items ' do
row = { username: 'user_name', fullname: 'user_fullname', email: '[email protected]' }
row = { username: 'user_name', name: 'user_name', email: '[email protected]' }
expect { CourseParticipant.import(row, nil, nil, nil) }.to raise_error("The record containing #{row[:username]} does not have enough items.")
end

Expand All @@ -38,7 +38,7 @@
row = []
allow(Course).to receive(:find).and_return(nil)
allow(session[:user]).to receive(:id).and_return(1)
row = { username: 'user_name', fullname: 'user_fullname', email: '[email protected]', password: 'user_password' }
row = { username: 'user_name', name: 'user_name', email: '[email protected]', password: 'user_password' }
expect { CourseParticipant.import(row, nil, session, 2) }.to raise_error('The course with the id "2" was not found.')
end

Expand All @@ -48,7 +48,7 @@
row = []
allow(Course).to receive(:find).and_return(course)
allow(session[:user]).to receive(:id).and_return(1)
row = { username: 'user_name', fullname: 'user_fullname', email: '[email protected]', role: 'user_role_name', parent: 'user_parent_name' }
row = { username: 'user_name', name: 'user_name', email: '[email protected]', role: 'user_role_name', parent: 'user_parent_name' }
course_part = CourseParticipant.import(row, nil, session, 2)
expect(course_part).to be_an_instance_of(CourseParticipant)
end
Expand Down

0 comments on commit 0441b5a

Please sign in to comment.