diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-10 03:09:09 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-10 03:09:09 +0000 |
commit | 63e90f0c44d45761c28137c6dd983b837a41a64c (patch) | |
tree | ad28839f4b184324fe4ff8730c1c819dac7e2ab7 /spec/helpers/snippets_helper_spec.rb | |
parent | 89cb3fa7748cad1d71417bcd5b69bf30b94c25b5 (diff) | |
download | gitlab-ce-63e90f0c44d45761c28137c6dd983b837a41a64c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers/snippets_helper_spec.rb')
-rw-r--r-- | spec/helpers/snippets_helper_spec.rb | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/spec/helpers/snippets_helper_spec.rb b/spec/helpers/snippets_helper_spec.rb index 5a3c8e37e8c..35882c9337b 100644 --- a/spec/helpers/snippets_helper_spec.rb +++ b/spec/helpers/snippets_helper_spec.rb @@ -32,7 +32,7 @@ RSpec.describe SnippetsHelper do end def download_link(url) - "<a class=\"btn\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Open raw\" href=\"#{url}\">#{external_snippet_icon('doc-code')}</a>" + "<a class=\"gl-button btn btn-default\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Open raw\" href=\"#{url}\">#{external_snippet_icon('doc-code')}</a>" end end @@ -59,31 +59,7 @@ RSpec.describe SnippetsHelper do end def download_link(url) - "<a class=\"btn\" target=\"_blank\" title=\"Download\" rel=\"noopener noreferrer\" href=\"#{url}?inline=false\">#{external_snippet_icon('download')}</a>" - end - end - - describe '#download_raw_snippet_button' do - subject { download_raw_snippet_button(snippet) } - - context 'with personal snippet' do - let(:snippet) { public_personal_snippet } - - it 'returns the download button' do - expect(subject).to eq(download_link("/-/snippets/#{snippet.id}/raw")) - end - end - - context 'with project snippet' do - let(:snippet) { public_project_snippet } - - it 'returns the download button' do - expect(subject).to eq(download_link("/#{snippet.project.path_with_namespace}/-/snippets/#{snippet.id}/raw")) - end - end - - def download_link(url) - "<a target=\"_blank\" rel=\"noopener noreferrer\" class=\"btn btn-sm has-tooltip\" title=\"Download\" data-container=\"body\" href=\"#{url}?inline=false\">#{sprite_icon('download')}</a>" + "<a class=\"gl-button btn btn-default\" target=\"_blank\" title=\"Download\" rel=\"noopener noreferrer\" href=\"#{url}?inline=false\">#{external_snippet_icon('download')}</a>" end end |