Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 03:08:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 03:08:11 +0300
commit93dcf45d441bc884b167f4338380c8c888e9b86f (patch)
treef55e8c1d39013380d1ff7d2a4e3cca537a35192a /spec/requests
parent0e68afab211a172b862a7acc774e1eda5da8e471 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/pipelines_spec.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/requests/api/pipelines_spec.rb b/spec/requests/api/pipelines_spec.rb
index a8f21f64a72..f43fa5b4185 100644
--- a/spec/requests/api/pipelines_spec.rb
+++ b/spec/requests/api/pipelines_spec.rb
@@ -3,11 +3,15 @@
require 'spec_helper'
describe API::Pipelines do
- let(:user) { create(:user) }
- let(:non_member) { create(:user) }
- let(:project) { create(:project, :repository, creator: user) }
+ let_it_be(:user) { create(:user) }
+ let_it_be(:non_member) { create(:user) }
- let!(:pipeline) do
+ # We need to reload as the shared example 'pipelines visibility table' is changing project
+ let_it_be(:project, reload: true) do
+ create(:project, :repository, creator: user)
+ end
+
+ let_it_be(:pipeline) do
create(:ci_empty_pipeline, project: project, sha: project.commit.id,
ref: project.default_branch, user: user)
end
@@ -26,7 +30,7 @@ describe API::Pipelines do
expect(response).to have_gitlab_http_status(:ok)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
- expect(json_response.first['sha']).to match /\A\h{40}\z/
+ expect(json_response.first['sha']).to match(/\A\h{40}\z/)
expect(json_response.first['id']).to eq pipeline.id
expect(json_response.first['web_url']).to be_present
expect(json_response.first.keys).to contain_exactly(*%w[id sha ref status web_url created_at updated_at])
@@ -438,7 +442,7 @@ describe API::Pipelines do
get api("/projects/#{project.id}/pipelines/#{pipeline.id}", user)
expect(response).to have_gitlab_http_status(:ok)
- expect(json_response['sha']).to match /\A\h{40}\z/
+ expect(json_response['sha']).to match(/\A\h{40}\z/)
end
it 'returns 404 when it does not exist' do