diff options
author | Rémy Coutable <remy@rymai.me> | 2016-03-18 22:26:30 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-03-18 22:26:30 +0300 |
commit | 9d15814eb00e86f0fac22c5650de9fbe9d512f40 (patch) | |
tree | 5a11c814fa94ba84dc594ad3ba66cd3c7af2a2fc /spec/helpers | |
parent | 738812240c34143f9527afc2ea9eb83885c75a21 (diff) |
Fix specs
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/labels_helper_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb index 4f129eca183..eca8bc8ab2d 100644 --- a/spec/helpers/labels_helper_spec.rb +++ b/spec/helpers/labels_helper_spec.rb @@ -11,7 +11,7 @@ describe LabelsHelper do end it 'uses the instance variable' do - expect(link_to_label(label)).to match %r{<a href="/#{@project.to_reference}/issues\?label_name=#{label.name}">.*</a>} + expect(link_to_label(label)).to match %r{<a href="/#{@project.to_reference}/issues\?label_name=#{label.name}"><span class="[\w\s\-]*has_tooltip".*</span></a>} end end @@ -39,6 +39,14 @@ describe LabelsHelper do end end + context 'with a tooltip argument' do + context 'set to false' do + it 'does not include the has_tooltip class' do + expect(link_to_label(label, tooltip: false)).not_to match %r{has_tooltip} + end + end + end + context 'with block' do it 'passes the block to link_to' do link = link_to_label(label) { 'Foo' } @@ -49,7 +57,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).and_return('Foo') + with(label, tooltip: true).and_return('Foo') expect(link_to_label(label)).to match('Foo') end end |