about summary refs log tree commit diff
path: root/spec/mailers/notification_mailer_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mailers/notification_mailer_spec.rb')
-rw-r--r--spec/mailers/notification_mailer_spec.rb46
1 files changed, 24 insertions, 22 deletions
diff --git a/spec/mailers/notification_mailer_spec.rb b/spec/mailers/notification_mailer_spec.rb
index 29bdc349b..a6db08d85 100644
--- a/spec/mailers/notification_mailer_spec.rb
+++ b/spec/mailers/notification_mailer_spec.rb
@@ -1,4 +1,6 @@
-require "rails_helper"
+# frozen_string_literal: true
+
+require 'rails_helper'
 
 RSpec.describe NotificationMailer, type: :mailer do
   let(:receiver)       { Fabricate(:user) }
@@ -19,69 +21,69 @@ RSpec.describe NotificationMailer, type: :mailer do
     end
   end
 
-  describe "mention" do
+  describe 'mention' do
     let(:mention) { Mention.create!(account: receiver.account, status: foreign_status) }
     let(:mail) { NotificationMailer.mention(receiver.account, Notification.create!(account: receiver.account, activity: mention)) }
 
     include_examples 'localized subject', 'notification_mailer.mention.subject', name: 'bob'
 
-    it "renders the headers" do
-      expect(mail.subject).to eq("You were mentioned by bob")
+    it 'renders the headers' do
+      expect(mail.subject).to eq('You were mentioned by bob')
       expect(mail.to).to eq([receiver.email])
     end
 
-    it "renders the body" do
-      expect(mail.body.encoded).to match("You were mentioned by bob")
+    it 'renders the body' do
+      expect(mail.body.encoded).to match('You were mentioned by bob')
       expect(mail.body.encoded).to include 'The body of the foreign status'
     end
   end
 
-  describe "follow" do
+  describe 'follow' do
     let(:follow) { sender.follow!(receiver.account) }
     let(:mail) { NotificationMailer.follow(receiver.account, Notification.create!(account: receiver.account, activity: follow)) }
 
     include_examples 'localized subject', 'notification_mailer.follow.subject', name: 'bob'
 
-    it "renders the headers" do
-      expect(mail.subject).to eq("bob is now following you")
+    it 'renders the headers' do
+      expect(mail.subject).to eq('bob is now following you')
       expect(mail.to).to eq([receiver.email])
     end
 
-    it "renders the body" do
-      expect(mail.body.encoded).to match("bob is now following you")
+    it 'renders the body' do
+      expect(mail.body.encoded).to match('bob is now following you')
     end
   end
 
-  describe "favourite" do
+  describe 'favourite' do
     let(:favourite) { Favourite.create!(account: sender, status: own_status) }
     let(:mail) { NotificationMailer.favourite(own_status.account, Notification.create!(account: receiver.account, activity: favourite)) }
 
     include_examples 'localized subject', 'notification_mailer.favourite.subject', name: 'bob'
 
-    it "renders the headers" do
-      expect(mail.subject).to eq("bob favourited your post")
+    it 'renders the headers' do
+      expect(mail.subject).to eq('bob favourited your post')
       expect(mail.to).to eq([receiver.email])
     end
 
-    it "renders the body" do
-      expect(mail.body.encoded).to match("Your post was favourited by bob")
+    it 'renders the body' do
+      expect(mail.body.encoded).to match('Your post was favourited by bob')
       expect(mail.body.encoded).to include 'The body of the own status'
     end
   end
 
-  describe "reblog" do
+  describe 'reblog' do
     let(:reblog) { Status.create!(account: sender, reblog: own_status) }
     let(:mail) { NotificationMailer.reblog(own_status.account, Notification.create!(account: receiver.account, activity: reblog)) }
 
     include_examples 'localized subject', 'notification_mailer.reblog.subject', name: 'bob'
 
-    it "renders the headers" do
-      expect(mail.subject).to eq("bob boosted your post")
+    it 'renders the headers' do
+      expect(mail.subject).to eq('bob boosted your post')
       expect(mail.to).to eq([receiver.email])
     end
 
-    it "renders the body" do
-      expect(mail.body.encoded).to match("Your post was boosted by bob")
+    it 'renders the body' do
+      expect(mail.body.encoded).to match('Your post was boosted by bob')
       expect(mail.body.encoded).to include 'The body of the own status'
     end
   end
@@ -98,7 +100,7 @@ RSpec.describe NotificationMailer, type: :mailer do
     end
 
     it 'renders the body' do
-      expect(mail.body.encoded).to match("bob has requested to follow you")
+      expect(mail.body.encoded).to match('bob has requested to follow you')
     end
   end
 end