Sha256: 6a9be3765c8f904f7f4089ce6889251ad4db5b8af7ef4fcc91969bc565cbe7cf

Contents?: true

Size: 890 Bytes

Versions: 7

Compression:

Stored size: 890 Bytes

Contents

require 'spec_helper.rb'

describe Canmoia::Work do
  let(:work_order) { Fabricate(:work_order) }

  it 'should include Camnoia::Work module ' do
    work_order.class.included_modules.should include Canmoia::Work
  end

  it 'should include Camnoia::Notification module ' do
    work_order.class.singleton_class.included_modules.should include Canmoia::Notification
  end

  describe 'when marked to notify and notification event triggered' do

    it 'should send email to responsible' do
      work_order.close!
      last_email.should deliver_to work_order.responsible
    end

    # it 'should fail when no mailer is found' do
    #   work_order.close!
    #   last_email.should deliver_to work_order.responsible
    # end

    # it 'should fail when no mail method is found' do
    #   work_order.close!
    #   last_email.should deliver_to work_order.responsible
    # end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
canmoia-0.3.0 spec/concerns/work_spec.rb
canmoia-0.2.0 spec/concerns/work_spec.rb
canmoia-0.1.0 spec/concerns/work_spec.rb
canmoia-0.0.4 spec/concerns/work_spec.rb
canmoia-0.0.3 spec/concerns/work_spec.rb
canmoia-0.0.2 spec/concerns/work_spec.rb
canmoia-0.0.1 spec/concerns/work_spec.rb