Sha256: ad66a6e1aa1f762a1737cf033d46b4a6fa3fcee0417655dabfaab66362a6f0b4

Contents?: true

Size: 683 Bytes

Versions: 15

Compression:

Stored size: 683 Bytes

Contents

require 'spec_helper'

describe Notifiable::Concern do
  let(:user1) { FactoryGirl.create(:user_with_mock_token) }
  let(:notification) { Notifiable::Notification.new(:message => "Test message")}
  
  before(:each) { FactoryGirl.create(:app) }
  
  it "sends a single push notification" do 
    FactoryGirl.create(:app)
       
    user1.send_notification(notification)
    
    Notifiable::NotificationStatus.count.should == 1    
  end
  
  it "sends zero notifications if the device is not valid" do
    user = FactoryGirl.build(:user_with_invalid_mock_token)
    
    user.send_notification(notification)
    
    Notifiable::NotificationStatus.count.should == 0    
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
notifiable-rails-0.16.0 spec/notifiable_spec.rb
notifiable-rails-0.15.3 spec/notifiable_spec.rb
notifiable-rails-0.15.2 spec/notifiable_spec.rb
notifiable-rails-0.15.1 spec/notifiable_spec.rb
notifiable-rails-0.15.0 spec/notifiable_spec.rb
notifiable-rails-0.14.1 spec/notifiable_spec.rb
notifiable-rails-0.14.0 spec/notifiable_spec.rb
notifiable-rails-0.13.0 spec/notifiable_spec.rb
notifiable-rails-0.12.1 spec/notifiable_spec.rb
notifiable-rails-0.12.0 spec/notifiable_spec.rb
notifiable-rails-0.11.0 spec/notifiable_spec.rb
notifiable-rails-0.10.1 spec/notifiable_spec.rb
notifiable-rails-0.10.0 spec/notifiable_spec.rb
notifiable-rails-0.9.0 spec/notifiable_spec.rb
notifiable-rails-0.8.0 spec/notifiable_spec.rb