Sha256: b81528ab8bd2159d4dfdaa250a145f2d2b5a9c149806c9c45b722f975604c45a

Contents?: true

Size: 1.1 KB

Versions: 25

Compression:

Stored size: 1.1 KB

Contents

require 'factory_girl_rails'

FactoryGirl.define do

  sequence :title do |n|
    "Foo Bar #{n}"
  end

  sequence :slug do |n|
    "foo-bar-#{n}"
  end

  factory :node, class: 'PushType::Node' do
    title   'Foo bar'
    slug    { generate :slug }

    factory :published_node do
      status 'published'
    end
  end

  sequence :email do |n|
    "joe-#{n}@example.com"
  end

  factory :user, class: 'PushType::User' do
    name    'Joe Bloggs'
    email   { generate :email }
  end

  factory :asset, class: 'PushType::Asset' do
    file    { Rack::Test::UploadedFile.new(PushType::Core::Engine.root.join('test', 'files/image.png')) }
    factory :image_asset do
    end
    factory :audio_asset do
      file  { Rack::Test::UploadedFile.new(PushType::Core::Engine.root.join('test', 'files/audio.m3u')) }
    end
    factory :video_asset do
      file  { Rack::Test::UploadedFile.new(PushType::Core::Engine.root.join('test', 'files/video.mp4')) }
    end
    factory :document_asset do
      file  { Rack::Test::UploadedFile.new(PushType::Core::Engine.root.join('test', 'files/document.pdf')) }
    end
  end
  
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
push_type_core-0.11.2 lib/push_type/testing/factories.rb
push_type_core-0.11.1 lib/push_type/testing/factories.rb
push_type_core-0.11.0.beta.2 lib/push_type/testing/factories.rb
push_type_core-0.11.0.beta.1 lib/push_type/testing/factories.rb
push_type_core-0.10.4 lib/push_type/testing/factories.rb
push_type_core-0.10.3 lib/push_type/testing/factories.rb
push_type_core-0.10.2 lib/push_type/testing/factories.rb
push_type_core-0.10.1 lib/push_type/testing/factories.rb
push_type_core-0.10.0 lib/push_type/testing/factories.rb
push_type_core-0.10.0.beta.5 lib/push_type/testing/factories.rb
push_type_core-0.10.0.beta.3 lib/push_type/testing/factories.rb
push_type_core-0.9.5 lib/push_type/testing/factories.rb
push_type_core-0.9.3 lib/push_type/testing/factories.rb
push_type_core-0.9.2 lib/push_type/testing/factories.rb
push_type_core-0.9.1 lib/push_type/testing/factories.rb
push_type_core-0.9.0 lib/push_type/testing/factories.rb
push_type_core-0.9.0.beta.4 lib/push_type/testing/factories.rb
push_type_core-0.9.0.beta.3 lib/push_type/testing/factories.rb
push_type_core-0.9.0.beta.2 lib/push_type/testing/factories.rb
push_type_core-0.8.2 lib/push_type/testing/factories.rb