2017-03-06 07:01:18 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::BuildsController do
|
|
|
|
include ApiHelpers
|
|
|
|
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:empty_project, :public) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'GET status.json' do
|
|
|
|
context 'when accessing status' do
|
|
|
|
before do
|
|
|
|
pipeline = create(:ci_pipeline, project: project)
|
|
|
|
build = create(:ci_build, pipeline: pipeline, status: 'success')
|
|
|
|
get :status, namespace_id: project.namespace,
|
2017-03-06 10:42:39 -05:00
|
|
|
project_id: project,
|
|
|
|
id: build.id,
|
|
|
|
format: :json
|
2017-03-06 07:01:18 -05:00
|
|
|
end
|
|
|
|
|
2017-03-10 07:56:35 -05:00
|
|
|
it 'return a correct pipeline status' do
|
2017-03-06 07:01:18 -05:00
|
|
|
expect(response).to have_http_status(:ok)
|
|
|
|
expect(json_response['details']['status']['text']).to eq 'passed'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|