Sha256: 120c0d90f64fc012e5205f3f6e9437697e84bc12c8cc2f36ee241822e8ffa984

Contents?: true

Size: 863 Bytes

Versions: 12

Compression:

Stored size: 863 Bytes

Contents

FactoryGirl.define do

  factory :mock_token, :class => Notifiable::DeviceToken do
    provider :mock
    sequence(:token) {|n| "ABCD#{n}" }
    app
  end
  
  factory :app, :class => Notifiable::App do
  end
  
  factory :notification, :class => Notifiable::Notification do
    app
  end
  
  
  factory :notification_status, :class => Notifiable::NotificationStatus do
    notification
    status 0
  end
  
  sequence(:email) {|n| "person-#{n}@example.com" }
  
  factory :user do
    email
    
    factory :user_with_mock_token do
      after(:create) do |user, evaluator|
        FactoryGirl.create(:mock_token, :user_id => user.id)
      end
    end
  
    factory :user_with_invalid_mock_token do
      after(:create) do |user, evaluator|
        FactoryGirl.create(:mock_token, :user_id => user.id, :is_valid => false)
      end
    end  
  end
  
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
notifiable-rails-0.17.0 spec/support/factories.rb
notifiable-rails-0.16.0 spec/support/factories.rb
notifiable-rails-0.15.3 spec/support/factories.rb
notifiable-rails-0.15.2 spec/support/factories.rb
notifiable-rails-0.15.1 spec/support/factories.rb
notifiable-rails-0.15.0 spec/support/factories.rb
notifiable-rails-0.14.1 spec/support/factories.rb
notifiable-rails-0.14.0 spec/support/factories.rb
notifiable-rails-0.13.0 spec/support/factories.rb
notifiable-rails-0.12.1 spec/support/factories.rb
notifiable-rails-0.12.0 spec/support/factories.rb
notifiable-rails-0.11.0 spec/support/factories.rb