Commit bf41ab26 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Add specs that target status failure

parent e0f90fb2
...@@ -110,7 +110,7 @@ describe API::API, api: true do ...@@ -110,7 +110,7 @@ describe API::API, api: true do
get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}", user) get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}", user)
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(json_response['status']).to be_nil expect(json_response['status']).to eq("created")
end end
end end
......
...@@ -9,11 +9,13 @@ describe 'projects/pipelines/show' do ...@@ -9,11 +9,13 @@ describe 'projects/pipelines/show' do
before do before do
controller.prepend_view_path('app/views/projects') controller.prepend_view_path('app/views/projects')
create_build('build', 0, 'build') create_build('build', 0, 'build', :success)
create_build('test', 1, 'rspec 0:2') create_build('test', 1, 'rspec 0:2', :pending)
create_build('test', 1, 'rspec 1:2') create_build('test', 1, 'rspec 1:2', :running)
create_build('test', 1, 'audit') create_build('test', 1, 'spinach 0:2', :created)
create_build('deploy', 2, 'production') create_build('test', 1, 'spinach 1:2', :created)
create_build('test', 1, 'audit', :created)
create_build('deploy', 2, 'production', :created)
create(:generic_commit_status, pipeline: pipeline, stage: 'external', name: 'jenkins', stage_idx: 3) create(:generic_commit_status, pipeline: pipeline, stage: 'external', name: 'jenkins', stage_idx: 3)
...@@ -37,6 +39,7 @@ describe 'projects/pipelines/show' do ...@@ -37,6 +39,7 @@ describe 'projects/pipelines/show' do
# builds # builds
expect(rendered).to have_text('rspec') expect(rendered).to have_text('rspec')
expect(rendered).to have_text('spinach')
expect(rendered).to have_text('rspec 0:2') expect(rendered).to have_text('rspec 0:2')
expect(rendered).to have_text('production') expect(rendered).to have_text('production')
expect(rendered).to have_text('jenkins') expect(rendered).to have_text('jenkins')
...@@ -44,7 +47,7 @@ describe 'projects/pipelines/show' do ...@@ -44,7 +47,7 @@ describe 'projects/pipelines/show' do
private private
def create_build(stage, stage_idx, name) def create_build(stage, stage_idx, name, status)
create(:ci_build, pipeline: pipeline, stage: stage, stage_idx: stage_idx, name: name) create(:ci_build, pipeline: pipeline, stage: stage, stage_idx: stage_idx, name: name, status: status)
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