about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-07 15:03:54 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-04-07 15:03:54 +0200
commit489f2508772a7214c219e66f8fa1aeea07ab6c08 (patch)
tree924b55981c4a10e06e499579b9e8beb3680c3a25 /spec
parent3f9959a4b66c8d33a1de6dd13972327ff62f2cd3 (diff)
parentce9dcbea32e7212dc19d83bbb7a21afe8756ced0 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'spec')
-rw-r--r--spec/mailers/user_mailer_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb
index 9c866788f..2ed33c1e4 100644
--- a/spec/mailers/user_mailer_spec.rb
+++ b/spec/mailers/user_mailer_spec.rb
@@ -83,4 +83,15 @@ describe UserMailer, type: :mailer do
     include_examples 'localized subject',
                      'devise.mailer.email_changed.subject'
   end
+
+  describe 'warning' do
+    let(:strike) { Fabricate(:account_warning, target_account: receiver.account, text: 'dont worry its just the testsuite', action: 'suspend') }
+    let(:mail)   { UserMailer.warning(receiver, strike) }
+
+    it 'renders warning notification' do
+      receiver.update!(locale: nil)
+      expect(mail.body.encoded).to include I18n.t("user_mailer.warning.title.suspend", acct: receiver.account.acct)
+      expect(mail.body.encoded).to include strike.text
+    end
+  end
 end