about summary refs log tree commit diff
path: root/spec/mailers/user_mailer_spec.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-07 15:25:53 +0200
committerGitHub <noreply@github.com>2022-04-07 15:25:53 +0200
commite0c39f9fad837b77373220515f078f2443ddf553 (patch)
tree70579b7050c39a90fbe35102d315f19410671541 /spec/mailers/user_mailer_spec.rb
parent3f9959a4b66c8d33a1de6dd13972327ff62f2cd3 (diff)
parented8a0bfbb80a759dc6944f599b89e52acb1e83b0 (diff)
Merge pull request #1736 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/mailers/user_mailer_spec.rb')
-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