mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-23 16:44:04 -05:00
36 lines
776 B
Ruby
36 lines
776 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe Admin::DashboardController do
|
|
render_views
|
|
|
|
describe 'GET #index' do
|
|
let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Owner')) }
|
|
|
|
before do
|
|
stub_system_checks
|
|
Fabricate :software_update
|
|
sign_in(user)
|
|
end
|
|
|
|
it 'returns http success and body with system check messages' do
|
|
get :index
|
|
|
|
expect(response)
|
|
.to have_http_status(200)
|
|
.and have_attributes(
|
|
body: include(I18n.t('admin.system_checks.software_version_patch_check.message_html'))
|
|
)
|
|
end
|
|
|
|
private
|
|
|
|
def stub_system_checks
|
|
stub_const 'Admin::SystemCheck::ACTIVE_CHECKS', [
|
|
Admin::SystemCheck::SoftwareVersionCheck,
|
|
]
|
|
end
|
|
end
|
|
end
|