diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-07 11:35:38 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-07 11:35:38 +0300 |
commit | d62a3decf945b448a7fcf2fdcf4c523d0b7d2eae (patch) | |
tree | 073a0fe9d046119c8caa28079a928bb93bc1890e /spec | |
parent | 2817c541375bcb5478bc2d922decb017efbe26a5 (diff) | |
parent | 222e1dc59cd559f893a4565040dede300645248b (diff) |
Merge branch 'fix_14638' into 'master'
Fixes #14638.
The SQL query was ambiguous and in this case we want to filter projects.
See merge request !3462
Diffstat (limited to 'spec')
-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 |