Sha256: a0fdacd9fa8adffd60928c75c29c75c03d72c6703c333d4f128435440c3617fd

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

FactoryGirl.define do

  to_create { |i| i.save }

  factory :blog, class: BlogModel do
    name { /\w+/.gen }
    owner
  end

  factory :user, class: UserModel, aliases: [:author, :owner] do
    first_name { /[:first_name:]/.gen }
    last_name { /[:last_name]/.gen }
    email { /[:email:]/.gen }
  end

  factory :post, class: PostModel do
    title { /\w+/.gen }
    body  { /\w+/.gen }
    created_at { DateTime.now - rand(100) }
    author
  end

  factory :comment, class: CommentModel do
    author
    post
  end

  factory :composite, class: CompositeIdSequelModel do
    id { /\w+/.gen }
    type { /\w+/.gen }

    name  { /\w+/.gen }
  end

  factory :other, class: OtherSequelModel do
    composite
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
praxis-mapper-4.4 spec/factories/all.rb
praxis-mapper-4.3 spec/factories/all.rb