blob: be6d6b2c0fa32baa1748804cef1a56cabfbe1efc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Public Snippets', :js, feature_category: :source_code_management do
let(:public_snippet) { create(:personal_snippet, :public, :repository) }
let(:content) { public_snippet.blobs.first.data.strip! }
it 'unauthenticated user should see public snippets' do
url = Gitlab::UrlBuilder.build(public_snippet)
visit snippet_path(public_snippet)
wait_for_requests
expect(page).to have_content(content)
click_button('Embed')
expect(page).to have_field('Embed', readonly: true, with: "<script src=\"#{url}.js\"></script>")
expect(page).to have_field('Share', readonly: true, with: url)
end
it 'unauthenticated user should see raw public snippets' do
visit raw_snippet_path(public_snippet)
expect(page).to have_content(content)
end
end
|