email_observer_spec.rb 388 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
require 'spec_helper'

describe EmailObserver do
  let(:email)      { create(:email) }

  before { subject.stub(notification: double('NotificationService').as_null_object) }

  subject { EmailObserver.instance }

  describe '#after_create' do
    it 'trigger notification to send emails' do
      subject.should_receive(:notification)

      subject.after_create(email)
    end
  end
end