Commit b8cbeff9 authored by Kamil Trzciński's avatar Kamil Trzciński

Fix `api/commits_spec.rb` cross-DB modification

Fixes specs to use FactoryGirl
instead.
parent 414f3cc6
......@@ -1056,9 +1056,7 @@ RSpec.describe API::Commits do
shared_examples_for 'ref with pipeline' do
let!(:pipeline) do
project
.ci_pipelines
.create!(source: :push, ref: 'master', sha: commit.sha, protected: false)
create(:ci_empty_pipeline, project: project, status: :created, source: :push, ref: 'master', sha: commit.sha, protected: false)
end
it 'includes status as "created" and a last_pipeline object' do
......@@ -1090,9 +1088,7 @@ RSpec.describe API::Commits do
shared_examples_for 'ref with unaccessible pipeline' do
let!(:pipeline) do
project
.ci_pipelines
.create!(source: :push, ref: 'master', sha: commit.sha, protected: false)
create(:ci_empty_pipeline, project: project, status: :created, source: :push, ref: 'master', sha: commit.sha, protected: false)
end
it 'does not include last_pipeline' do
......
......@@ -2,5 +2,4 @@
- "./spec/models/ci/build_trace_chunk_spec.rb"
- "./spec/models/ci/job_artifact_spec.rb"
- "./spec/models/clusters/applications/runner_spec.rb"
- "./spec/requests/api/commits_spec.rb"
- "./spec/services/ci/retry_build_service_spec.rb"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment