chore: Use "create!" and "save!" bang methods when not checking the result (#5358)
* Use "create!" when not checking for errors on the result * Use "save!" when not checking the result
This commit is contained in:
@@ -54,15 +54,15 @@ RSpec.describe ConversationReplyMailer, type: :mailer do
|
||||
|
||||
it 'renders the subject in conversation as reply' do
|
||||
conversation.additional_attributes = { 'mail_subject': 'Mail Subject' }
|
||||
conversation.save
|
||||
new_message.save
|
||||
conversation.save!
|
||||
new_message.save!
|
||||
expect(mail.subject).to eq('Re: Mail Subject')
|
||||
end
|
||||
|
||||
it 'not have private notes' do
|
||||
# make the message private
|
||||
private_message.private = true
|
||||
private_message.save
|
||||
private_message.save!
|
||||
|
||||
expect(mail.body.decoded).not_to include(private_message.content)
|
||||
expect(mail.body.decoded).to include(message.content)
|
||||
@@ -104,7 +104,7 @@ RSpec.describe ConversationReplyMailer, type: :mailer do
|
||||
let(:mail) { described_class.reply_without_summary(message_2.conversation, message_2.id).deliver_now }
|
||||
|
||||
before do
|
||||
message_2.save
|
||||
message_2.save!
|
||||
end
|
||||
|
||||
it 'renders the default subject' do
|
||||
@@ -113,14 +113,14 @@ RSpec.describe ConversationReplyMailer, type: :mailer do
|
||||
|
||||
it 'renders the subject in conversation' do
|
||||
conversation.additional_attributes = { 'mail_subject': 'Mail Subject' }
|
||||
conversation.save
|
||||
conversation.save!
|
||||
expect(mail.subject).to eq('Mail Subject')
|
||||
end
|
||||
|
||||
it 'not have private notes' do
|
||||
# make the message private
|
||||
private_message.private = true
|
||||
private_message.save
|
||||
private_message.save!
|
||||
expect(mail.body.decoded).not_to include(private_message.content)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user