Skip to content

Commit

Permalink
Fixed controller tests to conform to updated code, fixed spellling er…
Browse files Browse the repository at this point in the history
…rors causing the linting to fail
  • Loading branch information
brwali committed Nov 26, 2024
1 parent 72d8872 commit 99faa37
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/models/mentor_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class MentorManagement
#
# 1) Find all assignment participants for the
# assignment with id [assignment_id] whose
# duty is the same as [Particpant#DUTY_MENTOR].
# duty is the same as [Participant#DUTY_MENTOR].
# 2) Count the number of teams those participants
# are a part of, acting as a proxy for the
# number of teams they mentor.
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared_scripts/_user_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<th class="head">Submit</th>
<th class="head">Review</th>
<th class="head">Take quiz</th>
<!-- E2351 - on assignments, show the particpant's duty. header for this column -->
<!-- E2351 - on assignments, show the participant's duty. header for this column -->
<% if params[:model] == 'Assignment' %>
<th class="head">Mentor</th>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions lib/scoring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def compute_total_score(assignment, scores)
# Computes and returns the scores of assignment for participants and teams
# Returns data in the format of
# {
# :particpant => {
# :participant => {
# :<participant_id> => participant_scores(participant, questions),
# :<participant_id> => participant_scores(participant, questions)
# },
Expand Down Expand Up @@ -126,7 +126,7 @@ def review_grades(assignment, questions)
# Return scores that this participant has been given
# Returns data in the format of
# {
# :total_score => participant.grade ? particpant.grade : compute_total_score(assignment, scores)
# :total_score => participant.grade ? participant.grade : compute_total_score(assignment, scores)
# :max_pts_available => topic.micropayment if assignment.topics?
# :participant => participant,
# :questionnaire_symbol1 => {
Expand Down
7 changes: 3 additions & 4 deletions spec/controllers/metrics_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,15 @@
describe '#show' do
context 'when user hasn\'t logged in to GitHub' do
before(:each) do
params = {id: 900}
allow(controller).to receive(:authorize_github)
allow(controller).to receive(:github_metrics_for_submission)
allow(controller).to receive(:show)
session["github_access_token"] = nil
end

it 'redirects user to GitHub authorization page' do
params = {id: 900}
get :show, params
params = {id: 900, assignment_id: assignment.id}
get :show, params: params
expect(response.status).to eq(302) #redirected
end
end
Expand Down Expand Up @@ -244,7 +243,7 @@

it 'gets data from GitHub api v4(graphql)' do
response = controller.query_commit_statistics("{\"team\":\"rails\",\"players\":\"36\"}")
expect(response).to eq("message" => "Bad credentials", "documentation_url" => "https://docs.github.com/graphql")
expect(response).to eq("message" => "Bad credentials", "documentation_url" => "https://docs.github.com/graphql", "status"=>"401")
end
end

Expand Down

0 comments on commit 99faa37

Please sign in to comment.