Update feature visibility spec for projects edit page

This commit is contained in:
David Piegza 2017-03-07 23:14:22 +01:00
parent 130fd255bc
commit cd4073ca1b
1 changed files with 11 additions and 19 deletions

View File

@ -21,36 +21,28 @@ feature 'Project edit', feature: true, js: true do
expect(page).to have_selector('.merge-requests-feature', visible: false)
end
it 'hides merge requests section after save' do
select('Disabled', from: 'project_project_feature_attributes_merge_requests_access_level')
context 'given project with merge_requests_disabled access level' do
let(:project) { create(:project, :merge_requests_disabled) }
expect(page).to have_selector('.merge-requests-feature', visible: false)
click_button 'Save changes'
wait_for_ajax
expect(page).to have_selector('.merge-requests-feature', visible: false)
it 'hides merge requests section' do
expect(page).to have_selector('.merge-requests-feature', visible: false)
end
end
end
context 'builds select' do
it 'hides merge requests section' do
it 'hides builds select section' do
select('Disabled', from: 'project_project_feature_attributes_builds_access_level')
expect(page).to have_selector('.builds-feature', visible: false)
end
it 'hides merge requests section after save' do
select('Disabled', from: 'project_project_feature_attributes_builds_access_level')
context 'given project with builds_disabled access level' do
let(:project) { create(:project, :builds_disabled) }
expect(page).to have_selector('.builds-feature', visible: false)
click_button 'Save changes'
wait_for_ajax
expect(page).to have_selector('.builds-feature', visible: false)
it 'hides builds select section' do
expect(page).to have_selector('.builds-feature', visible: false)
end
end
end
end