2018-12-14 20:36:18 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2023-05-04 05:49:53 +02:00
|
|
|
describe Admin::DashboardController do
|
2021-05-06 14:22:54 +02:00
|
|
|
render_views
|
|
|
|
|
2018-12-14 20:36:18 +01:00
|
|
|
describe 'GET #index' do
|
2021-05-06 14:22:54 +02:00
|
|
|
before do
|
|
|
|
allow(Admin::SystemCheck).to receive(:perform).and_return([
|
2023-02-17 22:56:20 +01:00
|
|
|
Admin::SystemCheck::Message.new(:database_schema_check),
|
|
|
|
Admin::SystemCheck::Message.new(:rules_check, nil, admin_rules_path),
|
|
|
|
Admin::SystemCheck::Message.new(:sidekiq_process_check, 'foo, bar'),
|
|
|
|
])
|
2022-07-05 02:41:40 +02:00
|
|
|
sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin'))
|
2021-05-06 14:22:54 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns 200' do
|
2018-12-14 20:36:18 +01:00
|
|
|
get :index
|
|
|
|
|
|
|
|
expect(response).to have_http_status(200)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|