diff options
author | Mike Greiling <mgreiling@gitlab.com> | 2017-09-07 18:07:40 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-09-07 18:07:40 +0000 |
commit | 03b14b48a07e3bcab53b273bbeccdba1ef921ac2 (patch) | |
tree | f41b966fa0ea4e2b279be894ba9c59578e94e1fc /spec/features/projects/edit_spec.rb | |
parent | 21b16c5a168ebd79c6a5bcb9633752ecf4958089 (diff) | |
download | gitlab-ce-03b14b48a07e3bcab53b273bbeccdba1ef921ac2.tar.gz |
Resolve "Make project and features visibility settings less confusing"
Diffstat (limited to 'spec/features/projects/edit_spec.rb')
-rw-r--r-- | spec/features/projects/edit_spec.rb | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/spec/features/projects/edit_spec.rb b/spec/features/projects/edit_spec.rb index d3b1d1f7be3..17f914c9c17 100644 --- a/spec/features/projects/edit_spec.rb +++ b/spec/features/projects/edit_spec.rb @@ -1,20 +1,21 @@ require 'rails_helper' feature 'Project edit', js: true do + let(:admin) { create(:admin) } let(:user) { create(:user) } let(:project) { create(:project) } - before do - project.team << [user, :master] - sign_in(user) + context 'feature visibility' do + before do + project.team << [user, :master] + sign_in(user) - visit edit_project_path(project) - end + visit edit_project_path(project) + 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') + find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .project-feature-toggle').click expect(page).to have_selector('.merge-requests-feature', visible: false) end @@ -30,7 +31,7 @@ feature 'Project edit', js: true do context 'builds select' do it 'hides builds select section' do - select('Disabled', from: 'project_project_feature_attributes_builds_access_level') + find('.project-feature-controls[data-for="project[project_feature_attributes][builds_access_level]"] .project-feature-toggle').click expect(page).to have_selector('.builds-feature', visible: false) end @@ -44,4 +45,18 @@ feature 'Project edit', js: true do end end end + + context 'LFS enabled setting' do + before do + sign_in(admin) + end + + it 'displays the correct elements' do + allow(Gitlab.config.lfs).to receive(:enabled).and_return(true) + visit edit_project_path(project) + + expect(page).to have_content('Git Large File Storage') + expect(page).to have_selector('input[name="project[lfs_enabled]"] + button', visible: true) + end + end end |