Sha256: ae2cc15367a4f857a85d6b2dd5e52c008c08e7f25b3d3eb6ad985102d1476971

Contents?: true

Size: 1.18 KB

Versions: 12

Compression:

Stored size: 1.18 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe RequestLogAnalyzer::Mailer, 'mailer' do

  it "should initialize correctly" do
    @mailer = RequestLogAnalyzer::Mailer.new('alfa@beta.com', 'localhost', :debug => true) 
    @mailer.host.should eql("localhost")
    @mailer.port.should eql(25)
  end
  
  it "should allow alternate port settings" do
    @mailer = RequestLogAnalyzer::Mailer.new('alfa@beta.com', 'localhost:2525', :debug => true) 
    @mailer.host.should eql("localhost")
    @mailer.port.should eql("2525")
  end

  it "should store printed data" do
    @mailer = RequestLogAnalyzer::Mailer.new('alfa@beta.com', 'localhost', :debug => true)

    @mailer << 'test1'
    @mailer.puts 'test2'
    
    @mailer.data.should eql(['test1', 'test2'])
  end

  it "should send mail" do
    @mailer = RequestLogAnalyzer::Mailer.new('alfa@beta.com', 'localhost', :debug => true)

    @mailer << 'test1'
    @mailer.puts 'test2'

    mail = @mailer.mail
    
    mail[0].should include("contact@railsdoctors.com")
    mail[0].should include("test1")
    mail[0].should include("test2")

    mail[1].should include("contact@railsdoctors.com")
    mail[2].should include("alfa@beta.com")
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
request-log-analyzer-1.8.0 spec/unit/mailer_spec.rb
request-log-analyzer-1.7.0 spec/unit/mailer_spec.rb
request-log-analyzer-1.6.4 spec/unit/mailer_spec.rb
request-log-analyzer-1.6.3 spec/unit/mailer_spec.rb
request-log-analyzer-1.6.2 spec/unit/mailer_spec.rb
request-log-analyzer-1.6.1 spec/unit/mailer_spec.rb
request-log-analyzer-1.6.0 spec/unit/mailer_spec.rb
request-log-analyzer-1.5.4 spec/unit/mailer_spec.rb
request-log-analyzer-1.5.3 spec/unit/mailer_spec.rb
request-log-analyzer-1.5.2 spec/unit/mailer_spec.rb
request-log-analyzer-1.5.1 spec/unit/mailer_spec.rb
request-log-analyzer-1.5.0 spec/unit/mailer_spec.rb