Sha256: 99bd3040c53cdfe2200e600edf297856d0306410404e5524c32095dd8d9ffd3b

Contents?: true

Size: 796 Bytes

Versions: 11

Compression:

Stored size: 796 Bytes

Contents

require 'spec_helper'

describe Notifiable::NotifierBase do

  let(:notifiable_app) { FactoryGirl.create(:app, :configuration => {:configurable_mock => {:use_sandbox => true}}) }
  let(:notification) { FactoryGirl.create(:notification, :app => notifiable_app) }
  let(:notifier) { ConfigurableMockNotifier.new(Rails.env, notification) }
  
  before(:each) do
    ConfigurableMockNotifier.send(:public, *ConfigurableMockNotifier.protected_instance_methods)  
  end
  
  it "knows if the environment is test" do  
    notifier.test_env?.should == true
  end
  
  it "configures a notifier" do  
    notifiable_app.configure :configurable_mock, notifier

    notifier.use_sandbox.should == true
  end
  
end

class ConfigurableMockNotifier < Notifiable::NotifierBase
  attr_accessor :use_sandbox
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
notifiable-rails-0.19.9 spec/notifier_base_spec.rb
notifiable-rails-0.19.7 spec/notifier_base_spec.rb
notifiable-rails-0.19.6 spec/notifier_base_spec.rb
notifiable-rails-0.19.5 spec/notifier_base_spec.rb
notifiable-rails-0.19.4 spec/notifier_base_spec.rb
notifiable-rails-0.19.3 spec/notifier_base_spec.rb
notifiable-rails-0.19.2 spec/notifier_base_spec.rb
notifiable-rails-0.19.1 spec/notifier_base_spec.rb
notifiable-rails-0.19.0 spec/notifier_base_spec.rb
notifiable-rails-0.18.0 spec/notifier_base_spec.rb
notifiable-rails-0.17.0 spec/notifier_base_spec.rb