diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-12-22 10:15:49 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-12-22 10:15:49 +0000 |
commit | 7fc64dd18d9b2b6e3a2a01dab0007f7dd25c37ed (patch) | |
tree | 428602d5265cd981a2e33ace8aed6fc9594dd37c /spec/support/api | |
parent | fd3ab00cf90ddf081c61fb701721ca9180378bba (diff) | |
parent | 6d9c1d3efce00da95832feaaf36227bcbffecadf (diff) | |
download | gitlab-ce-pipeline-ui-updates.tar.gz |
Merge branch 'master' into pipeline-ui-updatespipeline-ui-updates
* master: (259 commits)
Exclude non existent repository storages.
fixed minor animation glitch in mini pipeline graph animation
Update Bitbucket callback URL documentation
Update build step for KaTeX.
Add KaTeX fonts to assets paths and precompile
Replace url('...') to url(font-path('...'))
Rname katex.css to katex.scss
Revert conflicting EE changes
Added Autodeploy script for OpenShift
Whitelist next project names: notes, services
Put back progress bar CSS
Remove unneeded bundle refs.
Adds entry to changelog
Reduce MR widget title by one pixel
Use same font size for all items in issue title
Adds background color for disabled state to merge when succeeds dropdown
Filter protocol-relative URLs in ExternalLinkFilter. Fixes issue #22742.
Move javascript for widget check to ci_bundle.
Introduce "Set up autodeploy" button to help configure GitLab CI for deployment
Whitelist next project names: help, ci, admin, search
...
Diffstat (limited to 'spec/support/api')
-rw-r--r-- | spec/support/api/repositories_shared_context.rb | 10 | ||||
-rw-r--r-- | spec/support/api/status_shared_examples.rb | 42 |
2 files changed, 52 insertions, 0 deletions
diff --git a/spec/support/api/repositories_shared_context.rb b/spec/support/api/repositories_shared_context.rb new file mode 100644 index 00000000000..ea38fe4f5b8 --- /dev/null +++ b/spec/support/api/repositories_shared_context.rb @@ -0,0 +1,10 @@ +shared_context 'disabled repository' do + before do + project.project_feature.update_attributes!( + repository_access_level: ProjectFeature::DISABLED, + merge_requests_access_level: ProjectFeature::DISABLED, + builds_access_level: ProjectFeature::DISABLED + ) + expect(project.feature_available?(:repository, current_user)).to be false + end +end diff --git a/spec/support/api/status_shared_examples.rb b/spec/support/api/status_shared_examples.rb new file mode 100644 index 00000000000..3481749a7f0 --- /dev/null +++ b/spec/support/api/status_shared_examples.rb @@ -0,0 +1,42 @@ +# Specs for status checking. +# +# Requires an API request: +# let(:request) { get api("/projects/#{project.id}/repository/branches", user) } +shared_examples_for '400 response' do + before do + # Fires the request + request + end + + it 'returns 400' do + expect(response).to have_http_status(400) + end +end + +shared_examples_for '403 response' do + before do + # Fires the request + request + end + + it 'returns 403' do + expect(response).to have_http_status(403) + end +end + +shared_examples_for '404 response' do + let(:message) { nil } + before do + # Fires the request + request + end + + it 'returns 404' do + expect(response).to have_http_status(404) + expect(json_response).to be_an Object + + if message.present? + expect(json_response['message']).to eq(message) + end + end +end |