Welcome to mirror list, hosted at ThFree Co, Russian Federation.

projects_controller_spec.rb « admin « controllers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 65587064eb15a188016acd0464081c395872cd4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'spec_helper'

describe Admin::ProjectsController do
  let!(:project) { create(:project, :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_level: [Gitlab::VisibilityLevel::PUBLIC]
      expect(response.body).to match(project.name)
    end

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