Commit 2d9e7468 authored by Lin Jen-Shin's avatar Lin Jen-Shin

They were moved to project_spec.rb

parent fa02d8fc
...@@ -915,40 +915,4 @@ describe Ci::Build, models: true do ...@@ -915,40 +915,4 @@ describe Ci::Build, models: true do
end end
end end
end end
describe 'Project#latest_successful_builds_for' do
let(:build) do
create(:ci_build, :artifacts, :success, pipeline: pipeline)
end
before do
build
end
context 'with succeed pipeline' do
it 'returns builds from ref' do
builds = project.latest_successful_builds_for('fix')
expect(builds).to contain_exactly(build)
end
it 'returns empty relation if the build cannot be found' do
builds = project.latest_successful_builds_for('TAIL').all
expect(builds).to be_empty
end
end
context 'with pending pipeline' do
before do
pipeline.update(status: 'pending')
end
it 'returns empty relation' do
builds = project.latest_successful_builds_for('fix').all
expect(builds).to be_empty
end
end
end
end end
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