Sha256: 572d56d538dc47e0f77a7d1b9c991d0484ff2922f7c0848c3cb29b2bbafc139c

Contents?: true

Size: 855 Bytes

Versions: 8

Compression:

Stored size: 855 Bytes

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
end

class ConfigurableMockNotifier < Notifiable::NotifierBase
  attr_accessor :use_sandbox
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
notifiable-rails-0.23.0 spec/model/notifiable_app_spec.rb
notifiable-rails-0.22.1 spec/model/notifiable_app_spec.rb
notifiable-rails-0.22.0 spec/model/notifiable_app_spec.rb
notifiable-rails-0.21.3 spec/model/notifiable_app_spec.rb
notifiable-rails-0.21.2 spec/model/notifiable_app_spec.rb
notifiable-rails-0.21.1 spec/model/notifiable_app_spec.rb
notifiable-rails-0.21.0 spec/model/notifiable_app_spec.rb
notifiable-rails-0.20.0 spec/model/notifiable_app_spec.rb