Admin mailer parameterization (#25759)
This commit is contained in:
parent
41a505513f
commit
cf33028f35
10 changed files with 40 additions and 36 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue