diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 12:07:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 12:07:45 +0000 |
commit | ac1dca43baa7b3b1ac7d60d89ad60fdeefed0b80 (patch) | |
tree | 33aa23ddf7f18ddbfba3d006041c460de88583b7 /spec/requests/api/internal | |
parent | f4186a753b86625a83e8499af14b5badd63a2ac2 (diff) | |
download | gitlab-ce-ac1dca43baa7b3b1ac7d60d89ad60fdeefed0b80.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/internal')
-rw-r--r-- | spec/requests/api/internal/base_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/requests/api/internal/base_spec.rb b/spec/requests/api/internal/base_spec.rb index 1f20a088e4f..95513776f39 100644 --- a/spec/requests/api/internal/base_spec.rb +++ b/spec/requests/api/internal/base_spec.rb @@ -315,6 +315,18 @@ describe API::Internal::Base do end end + shared_examples 'snippets with disabled feature flag' do + context 'when feature flag :version_snippets is disabled' do + it 'returns 404' do + stub_feature_flags(version_snippets: false) + + subject + + expect(response).to have_gitlab_http_status(:not_found) + end + end + end + context 'git push with personal snippet' do it 'responds with success' do push(key, personal_snippet) @@ -325,6 +337,10 @@ describe API::Internal::Base do expect(json_response["gl_repository"]).to eq("snippet-#{personal_snippet.id}") expect(user.reload.last_activity_on).to be_nil end + + it_behaves_like 'snippets with disabled feature flag' do + subject { push(key, personal_snippet) } + end end context 'git pull with personal snippet' do @@ -337,6 +353,10 @@ describe API::Internal::Base do expect(json_response["gl_repository"]).to eq("snippet-#{personal_snippet.id}") expect(user.reload.last_activity_on).to eql(Date.today) end + + it_behaves_like 'snippets with disabled feature flag' do + subject { pull(key, personal_snippet) } + end end context 'git push with project snippet' do @@ -349,6 +369,10 @@ describe API::Internal::Base do expect(json_response["gl_repository"]).to eq("snippet-#{project_snippet.id}") expect(user.reload.last_activity_on).to be_nil end + + it_behaves_like 'snippets with disabled feature flag' do + subject { push(key, project_snippet) } + end end context 'git pull with project snippet' do @@ -361,6 +385,10 @@ describe API::Internal::Base do expect(json_response["gl_repository"]).to eq("snippet-#{project_snippet.id}") expect(user.reload.last_activity_on).to eql(Date.today) end + + it_behaves_like 'snippets with disabled feature flag' do + subject { pull(key, project_snippet) } + end end context "git pull" do |