blob: 142db175a155be1984cccdf18e7c0788b1a1cdc6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Admin::DevOpsReportController do
describe 'show_adoption?' do
it 'is always false' do
expect(controller.show_adoption?).to be_falsey
end
end
describe 'should_track_devops_score?' do
it 'is always true' do
expect(controller.should_track_devops_score?).to be_truthy
end
end
describe 'GET #show' do
context 'as admin' do
let(:user) { create(:admin) }
before do
sign_in(user)
end
it 'responds with success' do
get :show
expect(response).to have_gitlab_http_status(:success)
end
it_behaves_like 'tracking unique visits', :show do
let(:target_id) { 'i_analytics_dev_ops_score' }
end
end
end
context 'as normal user' do
let(:user) { create(:user) }
before do
sign_in(user)
end
it 'responds with 404' do
get :show
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
|