debian-mirror-gitlab/spec/features/projects/edit_spec.rb

48 lines
1.4 KiB
Ruby
Raw Normal View History

2016-09-29 09:46:39 +05:30
require 'rails_helper'
2017-09-10 17:25:29 +05:30
feature 'Project edit', js: true do
2016-09-29 09:46:39 +05:30
let(:user) { create(:user) }
let(:project) { create(:project) }
before do
project.team << [user, :master]
2017-09-10 17:25:29 +05:30
sign_in(user)
2016-09-29 09:46:39 +05:30
2017-09-10 17:25:29 +05:30
visit edit_project_path(project)
2016-09-29 09:46:39 +05:30
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-08-17 22:00:37 +05:30
context 'given project with merge_requests_disabled access level' do
let(:project) { create(:project, :merge_requests_disabled) }
2016-09-29 09:46:39 +05:30
2017-08-17 22:00:37 +05:30
it 'hides merge requests section' do
expect(page).to have_selector('.merge-requests-feature', visible: false)
end
2016-09-29 09:46:39 +05:30
end
end
context 'builds select' do
2017-08-17 22:00:37 +05:30
it 'hides builds select section' do
2016-09-29 09:46:39 +05:30
select('Disabled', from: 'project_project_feature_attributes_builds_access_level')
expect(page).to have_selector('.builds-feature', visible: false)
end
2017-08-17 22:00:37 +05:30
context 'given project with builds_disabled access level' do
let(:project) { create(:project, :builds_disabled) }
2016-09-29 09:46:39 +05:30
2017-08-17 22:00:37 +05:30
it 'hides builds select section' do
expect(page).to have_selector('.builds-feature', visible: false)
end
2016-09-29 09:46:39 +05:30
end
end
end
end