2016-11-18 15:31:11 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-05-16 07:41:15 -04:00
|
|
|
describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do
|
2016-11-18 15:31:11 -05:00
|
|
|
include JavaScriptFixturesHelpers
|
|
|
|
|
|
|
|
let(:admin) { create(:admin) }
|
2016-11-19 18:40:37 -05:00
|
|
|
let(:namespace) { create(:namespace, name: 'frontend-fixtures' )}
|
|
|
|
let(:project) { create(:project_empty_repo, namespace: namespace, path: 'builds-project') }
|
2016-11-18 15:31:11 -05:00
|
|
|
let(:pipeline) { create(:ci_empty_pipeline, project: project) }
|
|
|
|
let!(:build_with_artifacts) { create(:ci_build, :success, :artifacts, :trace, pipeline: pipeline, stage: 'test', artifacts_expire_at: Time.now + 18.months) }
|
|
|
|
let!(:failed_build) { create(:ci_build, :failed, pipeline: pipeline, stage: 'build') }
|
|
|
|
let!(:pending_build) { create(:ci_build, :pending, pipeline: pipeline, stage: 'deploy') }
|
|
|
|
|
|
|
|
render_views
|
|
|
|
|
|
|
|
before(:all) do
|
|
|
|
clean_frontend_fixtures('builds/')
|
|
|
|
end
|
|
|
|
|
2017-08-10 18:31:42 -04:00
|
|
|
before do
|
2016-11-18 15:31:11 -05:00
|
|
|
sign_in(admin)
|
|
|
|
end
|
|
|
|
|
2017-08-22 19:19:35 -04:00
|
|
|
after do
|
|
|
|
remove_repository(project)
|
|
|
|
end
|
|
|
|
|
2016-11-18 15:31:11 -05:00
|
|
|
it 'builds/build-with-artifacts.html.raw' do |example|
|
|
|
|
get :show,
|
|
|
|
namespace_id: project.namespace.to_param,
|
2017-02-23 18:55:01 -05:00
|
|
|
project_id: project,
|
2016-11-18 15:31:11 -05:00
|
|
|
id: build_with_artifacts.to_param
|
|
|
|
|
|
|
|
expect(response).to be_success
|
|
|
|
store_frontend_fixture(response, example.description)
|
|
|
|
end
|
|
|
|
end
|