Sha256: 3c5cc59ce78fb49e2b9becd058500f9ea7f772752ddfd55370c584993f19e42a

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe Courier::Config do
  before do
    subject.services :active_mailer, :facebook
  end

  describe '#services' do
    it 'initialize services by name and preserve order' do
      subject.services.first.should be_kind_of(Courier::Service::ActiveMailer)
      subject.services.last.should be_kind_of(Courier::Service::Facebook)
    end

    it 'return ordered list of services when called with not args' do
      services=[1,2,3]
      subject.should_receive(:services_order) { services }
      subject.services.should == services
    end
  end

  describe '#get_service'

  describe '#template' do
    it 'sets default values for template' do
      subject.template :import_complete, :on, :off
      subject.get_template(:import_complete).should be_kind_of(Courier::Template::Base)
    end

    it 'raise errors when services counts not much' do
      expect { subject.template :import_complete, :on, :off, :off }.to raise_error
    end

    it 'raise errors when value unknown' do
      expect { subject.template :import_complete, :on, :bad_value }.to raise_error
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
courier-0.2.4 spec/courier/config_spec.rb
courier-0.2.3 spec/courier/config_spec.rb
courier-0.2.1 spec/courier/config_spec.rb
courier-0.2.0 spec/courier/config_spec.rb
courier-0.1.5 spec/courier/config_spec.rb
courier-0.1.4 spec/courier/config_spec.rb
courier-0.1.3 spec/courier/config_spec.rb
courier-0.1.2 spec/courier/config_spec.rb