2016-06-02 11:05:42 +05:30
|
|
|
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
|
2016-08-24 12:49:21 +05:30
|
|
|
get :index, visibility_level: [Gitlab::VisibilityLevel::PUBLIC]
|
2016-06-02 11:05:42 +05:30
|
|
|
expect(response.body).to match(project.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not retrieve the project' do
|
2016-08-24 12:49:21 +05:30
|
|
|
get :index, visibility_level: [Gitlab::VisibilityLevel::INTERNAL]
|
2016-06-16 23:09:34 +05:30
|
|
|
expect(response.body).not_to match(project.name)
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|