Commit a3c71d98 authored by Robert Speicher's avatar Robert Speicher

Add spec for ReferenceExtractor#labels

parent 31172475
...@@ -106,6 +106,15 @@ describe Gitlab::ReferenceExtractor do ...@@ -106,6 +106,15 @@ describe Gitlab::ReferenceExtractor do
expect(subject.merge_requests).to eq([@m1, @m0]) expect(subject.merge_requests).to eq([@m1, @m0])
end end
it 'accesses valid labels' do
@l0 = create(:label, title: 'one', project: project)
@l1 = create(:label, title: 'two', project: project)
@l2 = create(:label)
subject.analyze("~#{@l0.id}, ~999, ~#{@l2.id}, ~#{@l1.id}")
expect(subject.labels).to eq([@l0, @l1])
end
it 'accesses valid snippets' do it 'accesses valid snippets' do
@s0 = create(:project_snippet, project: project) @s0 = create(:project_snippet, project: project)
@s1 = create(:project_snippet, project: project) @s1 = create(:project_snippet, project: project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment