dashboard_controller_spec.rb 652 B

123456789101112131415161718192021222324
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe Admin::DashboardController, type: :controller do
  4. render_views
  5. describe 'GET #index' do
  6. before do
  7. allow(Admin::SystemCheck).to receive(:perform).and_return([
  8. Admin::SystemCheck::Message.new(:database_schema_check),
  9. Admin::SystemCheck::Message.new(:rules_check, nil, admin_rules_path),
  10. Admin::SystemCheck::Message.new(:sidekiq_process_check, 'foo, bar'),
  11. ])
  12. sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin'))
  13. end
  14. it 'returns 200' do
  15. get :index
  16. expect(response).to have_http_status(200)
  17. end
  18. end
  19. end