BigW Consortium Gitlab

projects_controller_spec.rb 628 Bytes
Newer Older
PotHix committed
1 2 3 4 5 6 7 8 9 10 11 12 13
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
14
      get :index, visibility_level: [Gitlab::VisibilityLevel::PUBLIC]
PotHix committed
15 16 17 18
      expect(response.body).to match(project.name)
    end

    it 'does not retrieve the project' do
19
      get :index, visibility_level: [Gitlab::VisibilityLevel::INTERNAL]
20
      expect(response.body).not_to match(project.name)
PotHix committed
21 22 23
    end
  end
end