diff options
author | PotHix <pothix@pothix.com> | 2016-04-06 12:05:50 -0300 |
---|---|---|
committer | PotHix <pothix@pothix.com> | 2016-04-06 13:56:28 -0300 |
commit | 222e1dc59cd559f893a4565040dede300645248b (patch) | |
tree | 0427068eef129755fbd50d5d0870262b2ff3f0c9 /spec/controllers/admin | |
parent | 801e870ddbce07b9171c08d739ea40007895a0cd (diff) | |
download | gitlab-ce-222e1dc59cd559f893a4565040dede300645248b.tar.gz |
Fixes #14638.
The SQL query was ambiguous and in this case we want to filter projects.
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r-- | spec/controllers/admin/projects_controller_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/admin/projects_controller_spec.rb b/spec/controllers/admin/projects_controller_spec.rb new file mode 100644 index 00000000000..2ba0d489197 --- /dev/null +++ b/spec/controllers/admin/projects_controller_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe Admin::ProjectsController do + let!(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } + + before do + sign_in(create(:admin)) + end + + describe 'GET /projects' do + render_views + + it 'retrieves the project for the given visibility level' do + get :index, visibility_levels: [Gitlab::VisibilityLevel::PUBLIC] + expect(response.body).to match(project.name) + end + + it 'does not retrieve the project' do + get :index, visibility_levels: [Gitlab::VisibilityLevel::INTERNAL] + expect(response.body).to_not match(project.name) + end + end +end |