From 942c6c63e8a899fe08f8df3a1a5078aec7342ea9 Mon Sep 17 00:00:00 2001 From: Omid Hemmati Date: Fri, 22 Nov 2024 00:30:14 -0500 Subject: [PATCH] adjusted message flash checking for testcases --- .../peer_reviews_controller_spec.rb | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/spec/controllers/peer_reviews_controller_spec.rb b/spec/controllers/peer_reviews_controller_spec.rb index 60a68e249c..edd8833048 100644 --- a/spec/controllers/peer_reviews_controller_spec.rb +++ b/spec/controllers/peer_reviews_controller_spec.rb @@ -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)) @@ -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 @@ -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 @@ -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