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