summaryrefslogtreecommitdiff
path: root/spec/helpers/snippets_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /spec/helpers/snippets_helper_spec.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/helpers/snippets_helper_spec.rb')
-rw-r--r--spec/helpers/snippets_helper_spec.rb50
1 files changed, 0 insertions, 50 deletions
diff --git a/spec/helpers/snippets_helper_spec.rb b/spec/helpers/snippets_helper_spec.rb
index a3244bec56f..5a3c8e37e8c 100644
--- a/spec/helpers/snippets_helper_spec.rb
+++ b/spec/helpers/snippets_helper_spec.rb
@@ -63,32 +63,6 @@ RSpec.describe SnippetsHelper do
end
end
- describe '#snippet_embed_tag' do
- subject { snippet_embed_tag(snippet) }
-
- context 'personal snippets' do
- let(:snippet) { public_personal_snippet }
-
- context 'public' do
- it 'returns a script tag with the snippet full url' do
- expect(subject).to eq(script_embed("http://test.host/-/snippets/#{snippet.id}"))
- end
- end
- end
-
- context 'project snippets' do
- let(:snippet) { public_project_snippet }
-
- it 'returns a script tag with the snippet full url' do
- expect(subject).to eq(script_embed("http://test.host/#{snippet.project.path_with_namespace}/-/snippets/#{snippet.id}"))
- end
- end
-
- def script_embed(url)
- "<script src=\"#{url}.js\"></script>"
- end
- end
-
describe '#download_raw_snippet_button' do
subject { download_raw_snippet_button(snippet) }
@@ -142,28 +116,4 @@ RSpec.describe SnippetsHelper do
end
end
end
-
- describe '#snippet_embed_input' do
- subject { snippet_embed_input(snippet) }
-
- context 'with PersonalSnippet' do
- let(:snippet) { public_personal_snippet }
-
- it 'returns the input component' do
- expect(subject).to eq embed_input(snippet_url(snippet))
- end
- end
-
- context 'with ProjectSnippet' do
- let(:snippet) { public_project_snippet }
-
- it 'returns the input component' do
- expect(subject).to eq embed_input(project_snippet_url(snippet.project, snippet))
- end
- end
-
- def embed_input(url)
- "<input type=\"text\" readonly=\"readonly\" class=\"js-snippet-url-area snippet-embed-input form-control\" data-url=\"#{url}\" value=\"<script src=&quot;#{url}.js&quot;></script>\" autocomplete=\"off\"></input>"
- end
- end
end