Commit dc6afd57 authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent 09114211
...@@ -6,7 +6,7 @@ describe Ci::Build, models: true do ...@@ -6,7 +6,7 @@ describe Ci::Build, models: true do
let(:pipeline) do let(:pipeline) do
create(:ci_pipeline, project: project, create(:ci_pipeline, project: project,
sha: project.commit.id, sha: project.commit.id,
ref: 'fix', ref: project.default_branch,
status: 'success') status: 'success')
end end
...@@ -680,8 +680,8 @@ describe Ci::Build, models: true do ...@@ -680,8 +680,8 @@ describe Ci::Build, models: true do
end end
context 'with succeed pipeline' do context 'with succeed pipeline' do
it 'returns builds for ref' do it 'returns builds for ref for default_branch' do
builds = project.latest_successful_builds_for('fix') builds = project.latest_successful_builds_for
expect(builds).to contain_exactly(build) expect(builds).to contain_exactly(build)
end end
...@@ -700,7 +700,7 @@ describe Ci::Build, models: true do ...@@ -700,7 +700,7 @@ describe Ci::Build, models: true do
end end
it 'returns empty relation' do it 'returns empty relation' do
builds = project.latest_successful_builds_for('fix') builds = project.latest_successful_builds_for
expect(builds).to be_kind_of(ActiveRecord::Relation) expect(builds).to be_kind_of(ActiveRecord::Relation)
expect(builds).to be_empty expect(builds).to be_empty
......
...@@ -192,8 +192,8 @@ describe API::API, api: true do ...@@ -192,8 +192,8 @@ describe API::API, api: true do
let(:pipeline) do let(:pipeline) do
create(:ci_pipeline, create(:ci_pipeline,
project: project, project: project,
sha: project.commit('fix').sha, sha: project.commit.sha,
ref: 'fix') ref: project.default_branch)
end end
let(:build) { create(:ci_build, :success, :artifacts, pipeline: pipeline) } let(:build) { create(:ci_build, :success, :artifacts, pipeline: pipeline) }
......
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