2019-10-17 02:07:30 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-05 06:34:42 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::PipelinesController, '(JavaScript fixtures)', type: :controller do
|
|
|
|
include JavaScriptFixturesHelpers
|
|
|
|
|
|
|
|
let(:admin) { create(:admin) }
|
|
|
|
let(:namespace) { create(:namespace, name: 'frontend-fixtures' )}
|
|
|
|
let(:project) { create(:project, :repository, namespace: namespace, path: 'pipelines-project') }
|
|
|
|
let(:commit) { create(:commit, project: project) }
|
|
|
|
let(:commit_without_author) { RepoHelpers.another_sample_commit }
|
2019-04-11 11:21:18 -04:00
|
|
|
let!(:user) { create(:user, developer_projects: [project], email: commit.author_email) }
|
2017-05-05 06:34:42 -04:00
|
|
|
let!(:pipeline) { create(:ci_pipeline, project: project, sha: commit.id, user: user) }
|
|
|
|
let!(:pipeline_without_author) { create(:ci_pipeline, project: project, sha: commit_without_author.id) }
|
|
|
|
let!(:pipeline_without_commit) { create(:ci_pipeline, project: project, sha: '0000') }
|
|
|
|
|
|
|
|
render_views
|
|
|
|
|
|
|
|
before(:all) do
|
|
|
|
clean_frontend_fixtures('pipelines/')
|
|
|
|
end
|
|
|
|
|
2017-08-10 18:31:42 -04:00
|
|
|
before do
|
2017-05-05 06:34:42 -04:00
|
|
|
sign_in(admin)
|
|
|
|
end
|
|
|
|
|
2019-04-21 06:58:07 -04:00
|
|
|
it 'pipelines/pipelines.json' do
|
2018-12-19 14:50:20 -05:00
|
|
|
get :index, params: {
|
2017-05-05 06:34:42 -04:00
|
|
|
namespace_id: namespace,
|
2018-12-19 14:50:20 -05:00
|
|
|
project_id: project
|
|
|
|
}, format: :json
|
2017-05-05 06:34:42 -04:00
|
|
|
|
2019-07-17 18:15:53 -04:00
|
|
|
expect(response).to be_successful
|
2017-05-05 06:34:42 -04:00
|
|
|
end
|
|
|
|
end
|