diff options
Diffstat (limited to 'spec/helpers/labels_helper_spec.rb')
-rw-r--r-- | spec/helpers/labels_helper_spec.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb index b4549630813..4877ab1ff03 100644 --- a/spec/helpers/labels_helper_spec.rb +++ b/spec/helpers/labels_helper_spec.rb @@ -275,9 +275,18 @@ RSpec.describe LabelsHelper do let(:html) { '<img src="example.png">This is an image</img>' } let(:label_with_html_content) { create(:label, title: 'test', description: html) } - it 'removes HTML' do - tooltip = label_tooltip_title(label_with_html_content) - expect(tooltip).to eq('This is an image') + context 'tooltip shows description' do + it 'removes HTML' do + tooltip = label_tooltip_title(label_with_html_content) + expect(tooltip).to eq('This is an image') + end + end + + context 'tooltip shows title' do + it 'shows title' do + tooltip = label_tooltip_title(label_with_html_content, tooltip_shows_title: true) + expect(tooltip).to eq('test') + end end end |