diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-09-22 08:39:47 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-09-22 08:39:47 +0000 |
commit | 55f772bb98a67ad346442a2cacb5646f6719b987 (patch) | |
tree | fdcda42d5ee9c746b5654a50fa88a0fd1464d3a8 /spec/helpers/icons_helper_spec.rb | |
parent | d103e95513704314a38ab8ae441851524031c4a1 (diff) | |
download | gitlab-ce-55f772bb98a67ad346442a2cacb5646f6719b987.tar.gz |
Resolve "Better SVG Usage in the Frontend"
Diffstat (limited to 'spec/helpers/icons_helper_spec.rb')
-rw-r--r-- | spec/helpers/icons_helper_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/helpers/icons_helper_spec.rb b/spec/helpers/icons_helper_spec.rb index 91c8faea7fd..3d79dac284f 100644 --- a/spec/helpers/icons_helper_spec.rb +++ b/spec/helpers/icons_helper_spec.rb @@ -16,6 +16,25 @@ describe IconsHelper do end end + describe 'sprite_icon' do + icon_name = 'clock' + + it 'returns svg icon html' do + expect(sprite_icon(icon_name).to_s) + .to eq "<svg><use xlink:href=\"/images/icons.svg##{icon_name}\"></use></svg>" + end + + it 'returns svg icon html + size classes' do + expect(sprite_icon(icon_name, size: 72).to_s) + .to eq "<svg class=\"s72\"><use xlink:href=\"/images/icons.svg##{icon_name}\"></use></svg>" + end + + it 'returns svg icon html + size classes + additional class' do + expect(sprite_icon(icon_name, size: 72, css_class: 'icon-danger').to_s) + .to eq "<svg class=\"s72 icon-danger\"><use xlink:href=\"/images/icons.svg##{icon_name}\"></use></svg>" + end + end + describe 'file_type_icon_class' do it 'returns folder class' do expect(file_type_icon_class('folder', 0, 'folder_name')).to eq 'folder' |