Sha256: b4087bf3ba7b67cced0b503ef3b107a08f967b874f5453d9fb1adf0bcf2a6ff7
Contents?: true
Size: 1.17 KB
Versions: 31
Compression:
Stored size: 1.17 KB
Contents
require File.dirname(__FILE__) + '/helper' class TestMailObject < Test::Unit::TestCase include Padrino::Mailer context 'for #deliver method' do should "send mail with attributes default to sendmail no smtp" do mail_object = Padrino::Mailer::MailObject.new({:to => "test@john.com", :from => "sender@sent.com", :body => "Hello"}, {}) Delivery.expects(:mail).with(:to => "test@john.com", :from => "sender@sent.com", :body => "Hello", :via => :sendmail) mail_object.deliver end should "send mail with attributes default to smtp if set" do mail_object = Padrino::Mailer::MailObject.new({:to => "test@john.com", :body => "Hello"}, { :host => 'smtp.gmail.com' }) Delivery.expects(:mail).with(:to => "test@john.com", :body => "Hello", :via => :smtp, :smtp => { :host => 'smtp.gmail.com' }) mail_object.deliver end should "send mail with attributes use sendmail if explicit" do mail_object = Padrino::Mailer::MailObject.new({:to => "test@john.com", :via => :sendmail }, { :host => 'smtp.gmail.com' }) Delivery.expects(:mail).with(:to => "test@john.com", :via => :sendmail) mail_object.deliver end end end
Version data entries
31 entries across 31 versions & 1 rubygems