2016-09-02 11:03:49 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-06-29 04:13:10 +00:00
|
|
|
feature 'Project edit', js: true do
|
2016-09-02 11:03:49 +00:00
|
|
|
let(:user) { create(:user) }
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project) }
|
2016-09-02 11:03:49 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
project.team << [user, :master]
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(user)
|
2016-09-02 11:03:49 +00:00
|
|
|
|
2017-07-06 16:20:50 +00:00
|
|
|
visit edit_project_path(project)
|
2016-09-02 11:03:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'feature visibility' do
|
|
|
|
context 'merge requests select' do
|
|
|
|
it 'hides merge requests section' do
|
|
|
|
select('Disabled', from: 'project_project_feature_attributes_merge_requests_access_level')
|
|
|
|
|
|
|
|
expect(page).to have_selector('.merge-requests-feature', visible: false)
|
|
|
|
end
|
|
|
|
|
2017-03-07 22:14:22 +00:00
|
|
|
context 'given project with merge_requests_disabled access level' do
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project, :merge_requests_disabled) }
|
2016-09-02 11:03:49 +00:00
|
|
|
|
2017-03-07 22:14:22 +00:00
|
|
|
it 'hides merge requests section' do
|
|
|
|
expect(page).to have_selector('.merge-requests-feature', visible: false)
|
|
|
|
end
|
2016-09-02 11:03:49 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'builds select' do
|
2017-03-07 22:14:22 +00:00
|
|
|
it 'hides builds select section' do
|
2016-09-02 11:03:49 +00:00
|
|
|
select('Disabled', from: 'project_project_feature_attributes_builds_access_level')
|
|
|
|
|
|
|
|
expect(page).to have_selector('.builds-feature', visible: false)
|
|
|
|
end
|
|
|
|
|
2017-03-07 22:14:22 +00:00
|
|
|
context 'given project with builds_disabled access level' do
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project, :builds_disabled) }
|
2016-09-02 11:03:49 +00:00
|
|
|
|
2017-03-07 22:14:22 +00:00
|
|
|
it 'hides builds select section' do
|
|
|
|
expect(page).to have_selector('.builds-feature', visible: false)
|
|
|
|
end
|
2016-09-02 11:03:49 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|