summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Bobin <mbobin@gitlab.com>2019-08-22 11:38:21 +0300
committerMarius Bobin <mbobin@gitlab.com>2019-08-22 11:39:53 +0300
commit574d0700f41afcf68e7ac5467b2dd711973d2ac9 (patch)
tree26a72aba66713036e3dcdab0a877d23e1685faeb
parente9f98fa94abcccfee88729c8de00574346293376 (diff)
downloadgitlab-ce-64269-pipeline-api-fails-with-401.tar.gz
Refactor pipelines specs for better readability64269-pipeline-api-fails-with-401
-rw-r--r--spec/requests/api/pipelines_spec.rb4
-rw-r--r--spec/support/shared_examples/requests/api/pipelines/visibility_table_examples.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/requests/api/pipelines_spec.rb b/spec/requests/api/pipelines_spec.rb
index 170959b58c6..174b3214d13 100644
--- a/spec/requests/api/pipelines_spec.rb
+++ b/spec/requests/api/pipelines_spec.rb
@@ -404,8 +404,8 @@ describe API::Pipelines do
describe 'GET /projects/:id/pipelines/:pipeline_id' do
it_behaves_like 'pipelines visibility table' do
- let(:execute_api_request) do
- get api("/projects/#{project.id}/pipelines/#{pipeline.id}", api_user)
+ let(:pipelines_api_path) do
+ "/projects/#{project.id}/pipelines/#{pipeline.id}"
end
let(:api_response) { response_status == 200 ? response : json_response }
diff --git a/spec/support/shared_examples/requests/api/pipelines/visibility_table_examples.rb b/spec/support/shared_examples/requests/api/pipelines/visibility_table_examples.rb
index ef845255f2b..dfd07176b1c 100644
--- a/spec/support/shared_examples/requests/api/pipelines/visibility_table_examples.rb
+++ b/spec/support/shared_examples/requests/api/pipelines/visibility_table_examples.rb
@@ -6,8 +6,8 @@ shared_examples 'pipelines visibility table' do
let(:ci_user) { create(:user) }
let(:api_user) { user_role && ci_user }
- let(:execute_api_request) do
- get api("/projects/#{project.id}/pipelines", api_user)
+ let(:pipelines_api_path) do
+ "/projects/#{project.id}/pipelines"
end
let(:response_200) do
@@ -224,7 +224,7 @@ shared_examples 'pipelines visibility table' do
project.project_feature.update!(project_feature_attributes)
project.add_role(ci_user, user_role) if user_role && user_role != :non_member
- execute_api_request
+ get api(pipelines_api_path, api_user)
end
it do