Sha256: 630535d88812dafca54b150de0e51fdb24ff16a82f7957cdbe0dd5cd289e352f

Contents?: true

Size: 804 Bytes

Versions: 2

Compression:

Stored size: 804 Bytes

Contents

require 'spec_helper'

describe AwsAlertMonitor::Emailer do

  describe 'send_email' do
    let(:ses_mock) { mock 'ses' }
    let(:args) do
      { 'body'    => 'foo bar',
        'emailer' => ses_mock,
        'from'    => 'root@example.com',
        'subject' => 'my subject',
        'to'      => ['bob@example.com', 'joe@example.com'] }
    end

    it 'sends the email with the correct info' do
      data = { :source      => args['from'],
               :destination => { :to_addresses => args['to'] },
               :message     => {
                 :subject => { :data => args['subject'] },
                 :body    => { :text => { :data => args['body']}} }
      }
      ses_mock.should_receive(:send_email).with(data)

      AwsAlertMonitor::Emailer.new(args).send_email
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aws-alert-monitor-0.1.0 spec/emailer_spec.rb
aws-alert-monitor-0.0.5 spec/emailer_spec.rb