2016-08-24 12:49:21 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
feature "Pipelines settings" do
|
|
|
|
let(:project) { create(:project) }
|
2016-08-24 12:49:21 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:role) { :developer }
|
|
|
|
|
|
|
|
background do
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
2016-08-24 12:49:21 +05:30
|
|
|
project.team << [user, role]
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_pipelines_settings_path(project)
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
context 'for developer' do
|
|
|
|
given(:role) { :developer }
|
|
|
|
|
|
|
|
scenario 'to be disallowed to view' do
|
|
|
|
expect(page.status_code).to eq(404)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'for master' do
|
|
|
|
given(:role) { :master }
|
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
scenario 'be allowed to change', js: true do
|
2016-08-24 12:49:21 +05:30
|
|
|
fill_in('Test coverage parsing', with: 'coverage_regex')
|
|
|
|
click_on 'Save changes'
|
|
|
|
|
|
|
|
expect(page.status_code).to eq(200)
|
2016-11-03 12:29:30 +05:30
|
|
|
expect(page).to have_button('Save changes', disabled: false)
|
2016-08-24 12:49:21 +05:30
|
|
|
expect(page).to have_field('Test coverage parsing', with: 'coverage_regex')
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
scenario 'updates auto_cancel_pending_pipelines' do
|
|
|
|
page.check('Auto-cancel redundant, pending pipelines')
|
|
|
|
click_on 'Save changes'
|
|
|
|
|
|
|
|
expect(page.status_code).to eq(200)
|
|
|
|
expect(page).to have_button('Save changes', disabled: false)
|
|
|
|
|
|
|
|
checkbox = find_field('project_auto_cancel_pending_pipelines')
|
|
|
|
expect(checkbox).to be_checked
|
|
|
|
end
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
end
|