Skip to content
Snippets Groups Projects
Commit 4f3dc19a authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Add specs for new pipeline action for JSON format

parent c68bf432
No related branches found
No related tags found
1 merge request!10584Resolve: "Pipelines: When we retry a pipeline 2 requests are made to the pipelines endpoint"
Pipeline #
Loading
Loading
@@ -5,6 +5,8 @@ describe Projects::PipelinesController do
let(:project) { create(:empty_project, :public) }
 
before do
project.add_developer(user)
sign_in(user)
end
 
Loading
Loading
@@ -87,4 +89,38 @@ describe Projects::PipelinesController do
expect(json_response['favicon']).to eq "/assets/ci_favicons/#{status.favicon}.ico"
end
end
describe 'POST retry.json' do
let!(:pipeline) { create(:ci_pipeline, :failed, project: project) }
let!(:build) { create(:ci_build, :failed, pipeline: pipeline) }
before do
post :retry, namespace_id: project.namespace,
project_id: project,
id: pipeline.id,
format: :json
end
it 'retries a pipeline without returning any content' do
expect(response).to have_http_status(:no_content)
expect(build.reload).to be_retried
end
end
describe 'POST cancel.json' do
let!(:pipeline) { create(:ci_pipeline, project: project) }
let!(:build) { create(:ci_build, :running, pipeline: pipeline) }
before do
post :cancel, namespace_id: project.namespace,
project_id: project,
id: pipeline.id,
format: :json
end
it 'cancels a pipeline without returning any content' do
expect(response).to have_http_status(:no_content)
expect(pipeline.reload).to be_canceled
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment