Merge commit '610cf6c3713e414995ea1a57110db400ccb88dd2' into glitch-soc/merge-upstream

Conflicts:
- `app/models/trends.rb`:
  Conflict due to glitch-soc's code splitting trends mailing depending on type.
  Ported upstream's changes.
This commit is contained in:
Claire
2023-07-12 15:38:35 +02:00
16 changed files with 104 additions and 76 deletions

View File

@ -23,8 +23,6 @@ RSpec.describe Api::V1::ReportsController do
let(:rule_ids) { nil }
before do
allow(AdminMailer).to receive(:new_report)
.and_return(instance_double(ActionMailer::MessageDelivery, deliver_later: nil))
post :create, params: { status_ids: [status.id], account_id: target_account.id, comment: 'reasons', category: category, rule_ids: rule_ids, forward: forward }
end
@ -41,7 +39,7 @@ RSpec.describe Api::V1::ReportsController do
end
it 'sends e-mails to admins' do
expect(AdminMailer).to have_received(:new_report).with(admin.account, Report)
expect(ActionMailer::Base.deliveries.first.to).to eq([admin.email])
end
context 'when a status does not belong to the reported account' do

View File

@ -14,13 +14,11 @@ RSpec.describe Disputes::AppealsController do
let(:strike) { Fabricate(:account_warning, target_account: current_user.account) }
before do
allow(AdminMailer).to receive(:new_appeal)
.and_return(instance_double(ActionMailer::MessageDelivery, deliver_later: nil))
post :create, params: { strike_id: strike.id, appeal: { text: 'Foo' } }
end
it 'notifies staff about new appeal' do
expect(AdminMailer).to have_received(:new_appeal).with(admin.account, Appeal.last)
expect(ActionMailer::Base.deliveries.first.to).to eq([admin.email])
end
it 'redirects back to the strike page' do