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 1226211 commit 942c6c6
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions spec/controllers/peer_reviews_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,6 @@
end

it 'flashes the correct message' do
undeleted_reviews = @assignment_with_pr.peer_reviews.map do |review|
I18n.t('activerecord.models.peer_review.reviewer_assigned_to_reviewee',
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 Expand Up @@ -422,7 +416,7 @@

it 'flashes the correct message' do
undeleted_reviews = @assignment_with_pr.peer_reviews.map do |review|
I18n.t('activerecord.models.peer_review.reviewer_assigned_to_reviewee',
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
Expand Down Expand Up @@ -452,12 +446,6 @@
end

it 'flashes the correct message' do
@assignment_with_pr.peer_reviews.map do |review|
I18n.t('activerecord.models.peer_review.reviewer_assigned_to_reviewee',
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 6 peer reviewer(s)')
end
Expand Down Expand Up @@ -490,12 +478,6 @@
end

it 'flashes the correct message' do
@assignment_with_pr.peer_reviews.map do |review|
I18n.t('activerecord.models.peer_review.reviewer_assigned_to_reviewee',
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 2 peer reviewer(s)')
end
Expand Down

0 comments on commit 942c6c6

Please sign in to comment.