gitlab-org--gitlab-foss/spec/features/snippets/internal_snippet_spec.rb
Sean McGivern d9ec830a83 Merge branch 'snippets_visibility' into 'security'
Fix snippets visibility for show action - external users can not see internal snippets

See merge request !2087
2017-05-10 16:44:20 +02:00

23 lines
546 B
Ruby

require 'rails_helper'
feature 'Internal Snippets', feature: true, js: true do
let(:internal_snippet) { create(:personal_snippet, :internal) }
describe 'normal user' do
before do
login_as :user
end
scenario 'sees internal snippets' do
visit snippet_path(internal_snippet)
expect(page).to have_content(internal_snippet.content)
end
scenario 'sees raw internal snippets' do
visit raw_snippet_path(internal_snippet)
expect(page).to have_content(internal_snippet.content)
end
end
end