Sha256: 97923c92c41e841b2285260424a120cefe5c259a8b07fb4414f7ccfdbcfac959

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

require File.join(File.dirname(__FILE__), "../spec_helper")

module Emailer
  describe MockSmtpFacade do
    
    describe :initialize do
      it "Should be able to send without actulay sending anything" do
        
        message = {:to => "test@bits2life.com",
        :from => "test@bits2life.com",
        :subject => "A test",
        :body => "A test body"}
        
        smtp = MockSmtpFacade.new
        
        smtp.open do
          smtp.send_mail(
            message
          )
        end
        
        smtp.last_email_sent.should == message
        
      end
    end
  
     describe :last_email_sent_url do
        it 'Should return url to last email sent' do
            smtp = MockSmtpFacade.new

            email = { 
              :to => "test@bits2life.com",
              :from => "test2@bits2life.com",
              :subject => "This is a test 4",
              :body => "Test body"
            }

            smtp.open do
              smtp.send_mail email
            end

            smtp.last_email_sent_url.should ==  TestingMiddleware.testing_path+smtp.sent.keys.last
        end
      end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bjornblomqvist-emailer-0.1.15 spec/emailer/mock_smtp_facade_spec.rb