about summary refs log tree commit diff
path: root/spec/mailers/admin_mailer_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mailers/admin_mailer_spec.rb')
-rw-r--r--spec/mailers/admin_mailer_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/mailers/admin_mailer_spec.rb b/spec/mailers/admin_mailer_spec.rb
index 4a8ef7b5e..29fb586a3 100644
--- a/spec/mailers/admin_mailer_spec.rb
+++ b/spec/mailers/admin_mailer_spec.rb
@@ -4,11 +4,15 @@ require 'rails_helper'
 
 RSpec.describe AdminMailer, type: :mailer do
   describe '.new_report' do
-    let(:sender)    { Fabricate(:account, username: 'John', user: Fabricate(:user)) }
-    let(:recipient) { Fabricate(:account, username: 'Mike', user: Fabricate(:user, locale: :en)) }
+    let(:sender)    { Fabricate(:account, username: 'John') }
+    let(:recipient) { Fabricate(:account, username: 'Mike') }
     let(:report)    { Fabricate(:report, account: sender, target_account: recipient) }
     let(:mail)      { described_class.new_report(recipient, report) }
 
+    before do
+      recipient.user.update(locale: :en)
+    end
+
     it 'renders the headers' do
       expect(mail.subject).to eq("New report for cb6e6126.ngrok.io (##{report.id})")
       expect(mail.to).to eq [recipient.user_email]