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:
authorGitLab Bot <gitlab-bot@gitlab.com>2024-01-03 03:07:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-03 03:07:15 +0300
commit25ba0c04e90a470bfdf3fe3a5b044a73157565d2 (patch)
tree9589a405ba956edeaa6d92a4fedbd3a1b422c793 /spec/models
parent3a72ac775065b61bbdb285a8f4f6f152ccb4db49 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/issue_email_participant_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/models/issue_email_participant_spec.rb b/spec/models/issue_email_participant_spec.rb
index 8ddc9a5f478..760af974275 100644
--- a/spec/models/issue_email_participant_spec.rb
+++ b/spec/models/issue_email_participant_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe IssueEmailParticipant do
+RSpec.describe IssueEmailParticipant, feature_category: :service_desk do
describe "Associations" do
it { is_expected.to belong_to(:issue) }
end
@@ -27,4 +27,18 @@ RSpec.describe IssueEmailParticipant do
expect(subject).to be_invalid
end
end
+
+ describe 'Scopes' do
+ describe '.with_emails' do
+ let!(:participant) { create(:issue_email_participant, email: 'user@example.com') }
+ let!(:participant1) { create(:issue_email_participant, email: 'user1@example.com') }
+ let!(:participant2) { create(:issue_email_participant, email: 'user2@example.com') }
+
+ it 'returns only participant with matching emails' do
+ expect(described_class.with_emails([participant.email, participant1.email])).to match_array(
+ [participant, participant1]
+ )
+ end
+ end
+ end
end