Skip to content

Commit

Permalink
adjusted message flash checking for testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
hemmatio committed Nov 22, 2024
1 parent 942c6c6 commit 625b64d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/controllers/peer_reviews_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@
end

it 'flashes the correct message' do
undeleted_reviews = @assignment_with_pr.peer_reviews.map do |review|
I18n.t('activerecord.models.peer_review.cannot_unassign_all_reviewers',
reviewer_group_name: review.reviewer.group.group_name,
reviewee_group_name: review.result.grouping.group.group_name)
end
flashed_error = flash[:error].map { |f| extract_text f }[0]
expect(flashed_error).to include('Successfully unassigned 1 peer reviewer(s)')
expect(flashed_error).to include(I18n.t('additional_not_shown', count: undeleted_reviews.length - 6))
Expand Down

0 comments on commit 625b64d

Please sign in to comment.