diff options
author | Sean McGivern <sean@gitlab.com> | 2017-04-25 14:41:26 +0000 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-05-10 16:44:20 +0200 |
commit | d9ec830a8348fca93775c5f0b1f81a83e8c4f95a (patch) | |
tree | 2c3949ca2f22bc195bb54a96fee5ac0971c6f745 /spec/features | |
parent | 9ae401cf91c9d545602b9aa86afcd306fc6e3467 (diff) | |
download | gitlab-ce-d9ec830a8348fca93775c5f0b1f81a83e8c4f95a.tar.gz |
Merge branch 'snippets_visibility' into 'security'
Fix snippets visibility for show action - external users can not see internal snippets
See merge request !2087
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/snippets/internal_snippet_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/features/snippets/internal_snippet_spec.rb b/spec/features/snippets/internal_snippet_spec.rb new file mode 100644 index 00000000000..93382f4c359 --- /dev/null +++ b/spec/features/snippets/internal_snippet_spec.rb @@ -0,0 +1,23 @@ +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 |