Sha256: 2c6a18956e51c731a67c68f4fdec375edf1f3a580c39eeba14d0672ccc9fa107

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

require 'spec_helper'

describe Notifiable::App do
  describe "#notifications" do
    subject(:notifiable_app) { create(:app) }
    let!(:notification) { create(:notification, :app => notifiable_app) }
    
    it { expect(notification.app).to_not be_nil }
    it { expect(notifiable_app.notifications.count).to eq 1 }
  end
  
  describe "#configure" do
    let(:notification) { create(:notification, :app => notifiable_app) }
    let(:notifier) { ConfigurableMockNotifier.new(Rails.env, notification) }
    subject(:notifiable_app) { create(:app, :configuration => {:configurable_mock => {:use_sandbox => true}}) }
    
    before(:each) { notifiable_app.configure :configurable_mock, notifier }
    
    it { expect(notifier.use_sandbox).to eq true }
  end
  
  describe "#configuration" do
    let(:notification) { create(:notification, :app => notifiable_app) }
    let(:notifier) { ConfigurableMockNotifier.new(Rails.env, notification) }
    subject(:notifiable_app) { create(:app) }
        
    it { expect(notifiable_app.send(:configuration)).to eq :mock => {}, :configurable_mock=>{:use_sandbox=>nil} }
  end
  
  describe "define_configuration_accessors" do        
    it { expect(Notifiable::App.instance_methods).to include(:configurable_mock_use_sandbox) }
    it { expect(Notifiable::App.instance_methods).to include(:configurable_mock_use_sandbox=) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
notifiable-rails-0.24.3 spec/model/notifiable_app_spec.rb
notifiable-rails-0.24.2 spec/model/notifiable_app_spec.rb
notifiable-rails-0.24.1 spec/model/notifiable_app_spec.rb