diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 15:08:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 15:08:50 +0000 |
commit | e06d0e779673d745972863302858105aad9032e5 (patch) | |
tree | 0ff35b27a949a164f586613004b4abfe33e7d20e /spec/helpers | |
parent | f7dae0cdcb70ecb71c1d65f099e9d96b27a4548c (diff) | |
download | gitlab-ce-e06d0e779673d745972863302858105aad9032e5.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/labels_helper_spec.rb | 12 | ||||
-rw-r--r-- | spec/helpers/markup_helper_spec.rb | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb index f5771405687..322390c3840 100644 --- a/spec/helpers/labels_helper_spec.rb +++ b/spec/helpers/labels_helper_spec.rb @@ -56,7 +56,7 @@ describe LabelsHelper do context 'without subject' do it "uses the label's project" do - expect(link_to_label(label_presenter)).to match %r{<a href="/#{label.project.full_path}/issues\?label_name%5B%5D=#{label.name}">.*</a>} + expect(link_to_label(label_presenter)).to match %r{<a.*href="/#{label.project.full_path}/issues\?label_name%5B%5D=#{label.name}".*>.*</a>}m end end @@ -65,7 +65,7 @@ describe LabelsHelper do let(:subject) { build(:project, namespace: namespace, name: 'bar3') } it 'links to project issues page' do - expect(link_to_label(label_presenter)).to match %r{<a href="/foo3/bar3/issues\?label_name%5B%5D=#{label.name}">.*</a>} + expect(link_to_label(label_presenter)).to match %r{<a.*href="/foo3/bar3/issues\?label_name%5B%5D=#{label.name}".*>.*</a>}m end end @@ -73,7 +73,7 @@ describe LabelsHelper do let(:subject) { build(:group, name: 'bar') } it 'links to group issues page' do - expect(link_to_label(label_presenter)).to match %r{<a href="/groups/bar/-/issues\?label_name%5B%5D=#{label.name}">.*</a>} + expect(link_to_label(label_presenter)).to match %r{<a.*href="/groups/bar/-/issues\?label_name%5B%5D=#{label.name}".*>.*</a>}m end end @@ -81,7 +81,7 @@ describe LabelsHelper do ['issue', :issue].each do |type| context "set to #{type}" do it 'links to correct page' do - expect(link_to_label(label_presenter, type: type)).to match %r{<a href="/#{label.project.full_path}/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}">.*</a>} + expect(link_to_label(label_presenter, type: type)).to match %r{<a.*href="/#{label.project.full_path}/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}".*>.*</a>}m end end end @@ -89,7 +89,7 @@ describe LabelsHelper do ['merge_request', :merge_request].each do |type| context "set to #{type}" do it 'links to correct page' do - expect(link_to_label(label_presenter, type: type)).to match %r{<a href="/#{label.project.full_path}/-/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}">.*</a>} + expect(link_to_label(label_presenter, type: type)).to match %r{<a.*href="/#{label.project.full_path}/-/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}".*>.*</a>}m end end end @@ -113,7 +113,7 @@ describe LabelsHelper do context 'without block' do it 'uses render_colored_label as the link content' do expect(self).to receive(:render_colored_label) - .with(label_presenter, tooltip: true).and_return('Foo') + .with(label_presenter).and_return('Foo') expect(link_to_label(label_presenter)).to match('Foo') end end diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb index 3fb36e540b6..c22e20f0e73 100644 --- a/spec/helpers/markup_helper_spec.rb +++ b/spec/helpers/markup_helper_spec.rb @@ -537,8 +537,10 @@ describe MarkupHelper do it 'does not style a label that can not be accessed by current_user' do project = create(:project, :private) + label = create_and_format_label(project) - expect(create_and_format_label(project)).to eq("<p>#{label_title}</p>") + expect(label).to include("~label_1") + expect(label).not_to match(/span class=.*style=.*/) end end |