Sha256: e41aa148f7ef84ee2c1fed100e64dbebd5a8ffd594022c7403a02caecd8282d8

Contents?: true

Size: 606 Bytes

Versions: 5

Compression:

Stored size: 606 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")}
  
  it "sends a single push notification" do    
    
    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

5 entries across 5 versions & 1 rubygems

Version Path
notifiable-rails-0.7.2 spec/notifiable_spec.rb
notifiable-rails-0.7.1 spec/notifiable_spec.rb
notifiable-rails-0.7.0 spec/notifiable_spec.rb
notifiable-rails-0.6.1 spec/notifiable_spec.rb
notifiable-rails-0.6.0 spec/notifiable_spec.rb