gitlab-org--gitlab-foss/spec/controllers/projects/builds_controller_spec.rb

31 lines
799 B
Ruby
Raw Normal View History

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
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