Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-11-09 14:23:14 +0300
committerTim Zallmann <tzallmann@gitlab.com>2017-11-09 14:23:14 +0300
commit81eaf1719c763c00357b404ab5d690e4a00bd131 (patch)
treec9ce1acaf2d4ebf056e8be1e61f72eef2da772bb /spec/helpers/icons_helper_spec.rb
parent25eea058335ed0149621fb7470c9e8db5a24b481 (diff)
Fixed URL Matching in Tests
Diffstat (limited to 'spec/helpers/icons_helper_spec.rb')
-rw-r--r--spec/helpers/icons_helper_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/helpers/icons_helper_spec.rb b/spec/helpers/icons_helper_spec.rb
index 0b5d96aaa2b..441668be028 100644
--- a/spec/helpers/icons_helper_spec.rb
+++ b/spec/helpers/icons_helper_spec.rb
@@ -16,10 +16,10 @@ describe IconsHelper do
end
end
- describe 'sprite_icon' do
+ describe 'sprite_icon_path' do
it 'returns relative path' do
expect(sprite_icon_path())
- .to eq "/image/icons.svg"
+ .to eq image_path("icons.svg")
end
context 'when an asset_host is set in the config it will return an absolute local URL' do
@@ -32,7 +32,7 @@ describe IconsHelper do
it 'returns an absolute URL on that asset host' do
gitlab_url = Gitlab.config.gitlab.url
expect(sprite_icon_path())
- .to eq "#{gitlab_url}/image/icons.svg"
+ .to eq image_path("icons.svg", host: Gitlab.config.gitlab.url)
end
end
end
@@ -42,17 +42,17 @@ describe IconsHelper do
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>"
+ .to eq "<svg><use xlink:href=\"#{image_path("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>"
+ .to eq "<svg class=\"s72\"><use xlink:href=\"#{image_path("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>"
+ .to eq "<svg class=\"s72 icon-danger\"><use xlink:href=\"#{image_path("icons.svg")}#{icon_name}\"></use></svg>"
end
end