Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/approval_spec.rb')
-rw-r--r--spec/models/approval_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/approval_spec.rb b/spec/models/approval_spec.rb
index 3d382c1712a..ff2f7408941 100644
--- a/spec/models/approval_spec.rb
+++ b/spec/models/approval_spec.rb
@@ -13,4 +13,16 @@ RSpec.describe Approval, feature_category: :code_review_workflow do
it { is_expected.to validate_uniqueness_of(:user_id).scoped_to([:merge_request_id]) }
end
+
+ describe '.with_invalid_patch_id_sha' do
+ let(:patch_id_sha) { 'def456' }
+ let!(:approval_1) { create(:approval, patch_id_sha: 'abc123') }
+ let!(:approval_2) { create(:approval, patch_id_sha: nil) }
+ let!(:approval_3) { create(:approval, patch_id_sha: patch_id_sha) }
+
+ it 'returns approvals with patch_id_sha not matching specified patch_id_sha' do
+ expect(described_class.with_invalid_patch_id_sha(patch_id_sha))
+ .to match_array([approval_1, approval_2])
+ end
+ end
end