Sha256: 3722efb3e27d12c330028453bd089a6e98fdf8ee0b9066753f0631356e0c7705

Contents?: true

Size: 773 Bytes

Versions: 15

Compression:

Stored size: 773 Bytes

Contents

require 'spec_helper'

describe Notifiable::Notification do
  
  it "stores a message" do    
    FactoryGirl.create(:notification, :message => "Test message")
    
    Notifiable::Notification.first.message.should eql "Test message"
  end
  
  it "stores params" do    
    FactoryGirl.create(:notification, :params => {:custom_property => "A different message"})
    
    Notifiable::Notification.first.params.should == {:custom_property => "A different message"}
  end
  
  it "destroys dependent NotificationStatuses" do
    n = FactoryGirl.create(:notification, :params => {:custom_property => "A different message"})
    Notifiable::NotificationStatus.create :notification => n
    
    n.destroy
    
    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/notification_spec.rb
notifiable-rails-0.15.3 spec/notification_spec.rb
notifiable-rails-0.15.2 spec/notification_spec.rb
notifiable-rails-0.15.1 spec/notification_spec.rb
notifiable-rails-0.15.0 spec/notification_spec.rb
notifiable-rails-0.14.1 spec/notification_spec.rb
notifiable-rails-0.14.0 spec/notification_spec.rb
notifiable-rails-0.13.0 spec/notification_spec.rb
notifiable-rails-0.12.1 spec/notification_spec.rb
notifiable-rails-0.12.0 spec/notification_spec.rb
notifiable-rails-0.11.0 spec/notification_spec.rb
notifiable-rails-0.10.1 spec/notification_spec.rb
notifiable-rails-0.10.0 spec/notification_spec.rb
notifiable-rails-0.9.0 spec/notification_spec.rb
notifiable-rails-0.8.0 spec/notification_spec.rb