summaryrefslogtreecommitdiff
path: root/spec/controllers/admin
diff options
context:
space:
mode:
authorPotHix <pothix@pothix.com>2016-04-06 12:05:50 -0300
committerPotHix <pothix@pothix.com>2016-04-06 13:56:28 -0300
commit222e1dc59cd559f893a4565040dede300645248b (patch)
tree0427068eef129755fbd50d5d0870262b2ff3f0c9 /spec/controllers/admin
parent801e870ddbce07b9171c08d739ea40007895a0cd (diff)
downloadgitlab-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.rb23
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