Sha256: 790347c566dd541a74d53dd9aacae2997bfa8e0297c986759fa9f61a18a4485f

Contents?: true

Size: 1011 Bytes

Versions: 4

Compression:

Stored size: 1011 Bytes

Contents

require 'spec_helper'

describe Feedbook::Notifiers::MailNotifier do
  
  let(:hash) do
    {
      'address'              => 'address',
      'port'                 => 'port',
      'domain'               => 'domain',
      'username'             => 'username',
      'password'             => 'password',
      'authentication'       => 'authentication',
      'enable_starttls_auto' => 'enable_starttls_auto',
      'to'                   => 'to',
      'from'                 => 'from',
      'subject'              => 'subject'
    }
  end

  subject { Feedbook::Notifiers::MailNotifier.instance }
  
  describe '#load_configuration' do
    it 'parses configuration hash and saves settings' do
      expect(Mail).to receive(:defaults)
      subject.load_configuration(hash)
    end
  end

  describe '#notify' do

    it 'create and send notification message to notifier' do
      expect(Mail).to receive(:deliver)
      subject.load_configuration(hash)

      subject.notify('message')
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
feedbook-1.1.0 spec/unit/lib/notifiers/mail_notifier_spec.rb
feedbook-1.0.0 spec/unit/lib/notifiers/mail_notifier_spec.rb
feedbook-0.9.1 spec/unit/lib/notifiers/mail_notifier_spec.rb
feedbook-0.9.0 spec/unit/lib/notifiers/mail_notifier_spec.rb