debian-mirror-gitlab/spec/controllers/admin/dev_ops_report_controller_spec.rb

48 lines
925 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Admin::DevOpsReportController do
2021-03-08 18:12:59 +05:30
describe 'show_adoption?' do
it 'is always false' do
2021-04-29 21:17:54 +05:30
expect(controller.show_adoption?).to be_falsey
end
end
2020-11-24 15:15:51 +05:30
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' }
2021-06-08 01:23:25 +05:30
let(:request_params) { { tab: 'devops-score' } }
2020-11-24 15:15:51 +05:30
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