Sha256: dd20b407f8115aac247060f4568b5b059ec2f46b9dd4ea9b63d5f8b5d62d0544

Contents?: true

Size: 814 Bytes

Versions: 1

Compression:

Stored size: 814 Bytes

Contents

FactoryGirl.define do
  factory :access_token, class: 'Landable::AccessToken' do
    association :author, strategy: :create
    permissions { { 'read' => 'true', 'edit' => 'true', 'publish' => 'true' } }
  end

  factory :author, class: 'Landable::Author' do
    sequence(:username) { |n| "trogdor#{n}" }
    sequence(:email)    { |n| "trogdor#{n}@example.com" }
    first_name 'Marley'
    last_name 'Pants'

    ignore do
      tokens_count 1
    end

    after(:create) do |author, evaluator|
      create_list(:access_token, evaluator.tokens_count, author: author)
    end
  end

  factory :author_without_access_tokens, class: 'Landable::Author' do
    sequence(:username) { |n| "trogdor#{n}" }
    sequence(:email)    { |n| "trogdor#{n}@example.com" }
    first_name 'Marley'
    last_name 'Pants'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
landable-1.14.0 spec/factories/authors.rb