2016-04-06 11:05:50 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Admin::ProjectsController do
|
2017-01-25 16:44:33 -05:00
|
|
|
let!(:project) { create(:empty_project, :public) }
|
2016-04-06 11:05:50 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(create(:admin))
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'GET /projects' do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
it 'retrieves the project for the given visibility level' do
|
2016-05-26 18:55:49 -04:00
|
|
|
get :index, visibility_level: [Gitlab::VisibilityLevel::PUBLIC]
|
2016-04-06 11:05:50 -04:00
|
|
|
expect(response.body).to match(project.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not retrieve the project' do
|
2016-05-26 18:55:49 -04:00
|
|
|
get :index, visibility_level: [Gitlab::VisibilityLevel::INTERNAL]
|
2016-05-23 19:37:59 -04:00
|
|
|
expect(response.body).not_to match(project.name)
|
2016-04-06 11:05:50 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|