0
0
Fork 0

Autofix Rubocop Style/StringLiterals (#23695)

This commit is contained in:
Nick Schonning 2023-02-18 17:38:14 -05:00 committed by GitHub
parent ac3561098e
commit 81ad6c2e39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 277 additions and 359 deletions

View file

@ -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