1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Restore action log specs

This commit is contained in:
Matt Jankowski 2024-05-27 09:34:45 -04:00
parent 1a66aaaeb6
commit 3835f8286a
2 changed files with 19 additions and 2 deletions

View file

@ -215,8 +215,13 @@ RSpec.describe Admin::AccountsController do
it 'succeeds in rejecting account and logs action' do it 'succeeds in rejecting account and logs action' do
expect(subject).to redirect_to admin_accounts_path(status: 'pending') expect(subject).to redirect_to admin_accounts_path(status: 'pending')
expect { account.reload } expect(latest_admin_action_log)
.to raise_error(ActiveRecord::RecordNotFound) .to be_present
.and have_attributes(
action: eq(:reject),
account_id: eq(current_user.account_id),
target_id: eq(account.user.id)
)
end end
end end

View file

@ -199,6 +199,18 @@ RSpec.describe 'Accounts' do
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(User.where(id: account.user.id)).to_not exist expect(User.where(id: account.user.id)).to_not exist
end end
it 'logs action', :aggregate_failures do
subject
expect(latest_admin_action_log)
.to be_present
.and have_attributes(
action: eq(:reject),
account_id: eq(user.account_id),
target_id: eq(account.user.id)
)
end
end end
context 'when account is already approved' do context 'when account is already approved' do