summaryrefslogtreecommitdiff
path: root/spec/models/label_link_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-12 12:10:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-12 12:10:24 +0000
commit71a67d17b02e7b8dec2f4c257f6734dc7818fb1e (patch)
tree6b45633257869a67fd534bd2cf899b93a48794c0 /spec/models/label_link_spec.rb
parent133ec9237af290062aae70e6f115db69b51c88de (diff)
downloadgitlab-ce-71a67d17b02e7b8dec2f4c257f6734dc7818fb1e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/label_link_spec.rb')
-rw-r--r--spec/models/label_link_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/label_link_spec.rb b/spec/models/label_link_spec.rb
index a95481f3083..c6bec215145 100644
--- a/spec/models/label_link_spec.rb
+++ b/spec/models/label_link_spec.rb
@@ -12,4 +12,15 @@ RSpec.describe LabelLink do
let(:valid_items_for_bulk_insertion) { build_list(:label_link, 10) }
let(:invalid_items_for_bulk_insertion) { [] } # class does not have any validations defined
end
+
+ describe '.for_target' do
+ it 'returns the label links for a given target' do
+ label_link = create(:label_link, target: create(:merge_request))
+
+ create(:label_link, target: create(:issue))
+
+ expect(described_class.for_target(label_link.target_id, label_link.target_type))
+ .to contain_exactly(label_link)
+ end
+ end
end