2016-07-20 08:33:13 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
feature "Pipelines settings", feature: true do
|
|
|
|
include GitlabRoutingHelper
|
|
|
|
|
|
|
|
let(:project) { create(:empty_project) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:role) { :developer }
|
|
|
|
|
|
|
|
background do
|
|
|
|
login_as(user)
|
|
|
|
project.team << [user, role]
|
|
|
|
visit namespace_project_pipelines_settings_path(project.namespace, project)
|
|
|
|
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-10-18 06:53:30 -04:00
|
|
|
scenario 'be allowed to change', js: true do
|
2016-07-20 08:33:13 -04:00
|
|
|
fill_in('Test coverage parsing', with: 'coverage_regex')
|
|
|
|
click_on 'Save changes'
|
|
|
|
|
|
|
|
expect(page.status_code).to eq(200)
|
2016-10-18 06:53:30 -04:00
|
|
|
expect(page).to have_button('Save changes', disabled: false)
|
2016-07-20 08:33:13 -04:00
|
|
|
expect(page).to have_field('Test coverage parsing', with: 'coverage_regex')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|