spec/lib/sendgrid_actionmailer_spec.rb in sendgrid-actionmailer-2.5.0 vs spec/lib/sendgrid_actionmailer_spec.rb in sendgrid-actionmailer-2.6.0
- old
+ new
@@ -262,9 +262,23 @@
it 'does not set unsubscribe substitutions' do
mailer.deliver!(mail)
expect(client.sent_mail['personalizations'].first).to_not have_key('substitutions')
end
+
+ it 'does not set send a content type' do
+ mailer.deliver!(mail)
+ expect(client.sent_mail['content']).to eq(nil)
+ end
+
+ it 'does not set send a content type even if body is given' do
+ # This matches the default behavior of ActionMail. body must be
+ # specified and content_type defaults to text/plain.
+ mail.body = 'I heard you like pineapple.'
+ mail.content_type = 'text/plain'
+ mailer.deliver!(mail)
+ expect(client.sent_mail['content']).to eq(nil)
+ end
end
context 'without dynamic template data or a template id' do
it 'sets unsubscribe substitutions' do
mailer.deliver!(mail)