From a3c71d9898ac762ebec8800a68f8aaae7671773c Mon Sep 17 00:00:00 2001 From: Robert Speicher <rspeicher@gmail.com> Date: Wed, 15 Apr 2015 14:02:36 -0400 Subject: [PATCH] Add spec for ReferenceExtractor#labels --- spec/lib/gitlab/reference_extractor_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/lib/gitlab/reference_extractor_spec.rb b/spec/lib/gitlab/reference_extractor_spec.rb index f34b6f3878e..6fba140f69d 100644 --- a/spec/lib/gitlab/reference_extractor_spec.rb +++ b/spec/lib/gitlab/reference_extractor_spec.rb @@ -106,6 +106,15 @@ describe Gitlab::ReferenceExtractor do expect(subject.merge_requests).to eq([@m1, @m0]) 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 @s0 = create(:project_snippet, project: project) @s1 = create(:project_snippet, project: project) -- GitLab