Merge commit 'f7b1769e8a69e2831493f3a704d68efa5cf9beff' into glitch-soc/merge-upstream

This commit is contained in:
Claire committed 2025-03-19 20:09:14 +01:00
commit 971690caf2
10 files changed
+50 -50

No files matched your search

@@ -1,35 +0,0 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Admin::AccountActionsController do
render_views
let(:user) { Fabricate(:admin_user) }
before do
sign_in user, scope: :user
end
describe 'GET #new' do
let(:account) { Fabricate(:account) }
it 'returns http success' do
get :new, params: { account_id: account.id }
expect(response).to have_http_status(:success)
end
end
describe 'POST #create' do
let(:account) { Fabricate(:account) }
it 'records the account action' do
expect do
post :create, params: { account_id: account.id, admin_account_action: { type: 'silence' } }
end.to change { account.strikes.count }.by(1)
expect(response).to redirect_to(admin_account_path(account.id))
end
end
end
@@ -1,35 +0,0 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Admin::DashboardController do
render_views
describe 'GET #index' do
let(:user) { Fabricate(:owner_user) }
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