Autofix Rubocop Style/StringLiterals (#23695)
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
require "rails_helper"
 | 
			
		||||
require 'rails_helper'
 | 
			
		||||
 | 
			
		||||
RSpec.describe NotificationMailer, type: :mailer do
 | 
			
		||||
  let(:receiver)       { Fabricate(:user) }
 | 
			
		||||
@@ -19,69 +19,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 +98,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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user