Sha256: 5eecb27f47ecbef066e299ea2ad3a43c7bf806074602ae3e220b78fc2017e6df

Contents?: true

Size: 1.25 KB

Versions: 24

Compression:

Stored size: 1.25 KB

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'flapjack', 'notifiers', 'mailer', 'init')
require File.join(File.dirname(__FILE__), '..', 'helpers')

describe "mailing notifier" do 

  it "should error if no from address is provided" do 
    lambda {
      mailer = Flapjack::Notifiers::Mailer.new(:log => MockLogger.new)
    }.should raise_error(ArgumentError, /from address/)
  end

  it "should error if no recipient is provided" do
    mailer = Flapjack::Notifiers::Mailer.new(:from_address => "test@example.org")
    lambda {
      mailer.notify()
    }.should raise_error(ArgumentError, /recipient/)
  end

  it "should error if no result is provided" do
    mailer = Flapjack::Notifiers::Mailer.new(:from_address => "test@example.org")
    lambda {
      mailer.notify(:who => 'foo')
    }.should raise_error(ArgumentError, /result/)
  end

  it "should deliver mail to a recipient" do 
    mailer = Flapjack::Notifiers::Mailer.new(:from_address => "test@example.org")
    response = mailer.notify(:who => OpenStruct.new(:email => "nobody@example.org"), 
                             :result => OpenStruct.new(:id => 11, :status => 2, :output => "foo"))
    response.status.should == '250'
  end

  it "should have a configurable server to send through"
end


Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
flapjack-0.6.43 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.42 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.41 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.40 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.39 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.38 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.37 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.36 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.35 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.34 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.33 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.32 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.31 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.30 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.29 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.28 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.27 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.26 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.25 spec.old/notifiers/mailer_spec.rb
flapjack-0.6.24 spec.old/notifiers/mailer_spec.rb