summaryrefslogtreecommitdiff
path: root/spec/features/snippets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-29 21:06:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-29 21:06:13 +0000
commit839c080dd0976f19c274eee1331c47985490cd41 (patch)
treeda3af62d5469f80c7555f9e8df11c18049e0334e /spec/features/snippets
parent8263f6ee3131cdea3c6041785c32771a6af0b24f (diff)
downloadgitlab-ce-839c080dd0976f19c274eee1331c47985490cd41.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/snippets')
-rw-r--r--spec/features/snippets/show_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/features/snippets/show_spec.rb b/spec/features/snippets/show_spec.rb
index edf7d37fd6d..450e520e293 100644
--- a/spec/features/snippets/show_spec.rb
+++ b/spec/features/snippets/show_spec.rb
@@ -158,4 +158,21 @@ describe 'Snippet', :js do
subject { visit snippet_path(snippet) }
end
+
+ context 'when user cannot create snippets' do
+ let(:user) { create(:user, :external) }
+ let(:snippet) { create(:personal_snippet, :public) }
+
+ before do
+ sign_in(user)
+
+ visit snippet_path(snippet)
+
+ wait_for_requests
+ end
+
+ it 'does not show the "New Snippet" button' do
+ expect(page).not_to have_link('New snippet')
+ end
+ end
end