spec/integration/delivery_handler_spec.rb in mandrill-mailer-rails-1.0.0 vs spec/integration/delivery_handler_spec.rb in mandrill-mailer-rails-1.1.0

- old
+ new

@@ -68,11 +68,11 @@ ) Notifier.test.deliver end - it 'should set the from field' do + it 'should set the from_email field' do expect(sender).to receive(:send).with( hash_including( :from_email => Notifier::FROM ) ) @@ -107,9 +107,39 @@ :from_name => Notifier::FROM_NAME ) ) Notifier.test_from_email_with_name.deliver + end + it 'should set the from_email field' do + expect(sender).to receive(:send).with( + hash_including( + :from_email => Notifier::FROM + ) + ) + + Notifier.test_from_email_with_name.deliver + end + end + + context 'when the from field contains a name and email' do + it 'should set the from_name field' do + expect(sender).to receive(:send).with( + hash_including( + :from_name => Notifier::FROM_NAME + ) + ) + + Notifier.test_from_email_in_from.deliver + end + it 'should set the from_email field' do + expect(sender).to receive(:send).with( + hash_including( + :from_email => Notifier::FROM + ) + ) + + Notifier.test_from_email_in_from.deliver end end it 'should set the to field' do expect(sender).to receive(:send).with(