Sha256: 0921cd6f05505e8142c250a0b695af780229ab671f9fc02bee5d59a9e1b7a797

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

require 'factory_girl_rails'

FactoryGirl.define do
  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

8 entries across 8 versions & 1 rubygems

Version Path
push_type_core-0.3.3 lib/push_type/testing/factories.rb
push_type_core-0.3.1 lib/push_type/testing/factories.rb
push_type_core-0.2.1 lib/push_type/testing/factories.rb
push_type_core-0.2.0 lib/push_type/testing/factories.rb
push_type_core-0.2.0.beta2 lib/push_type/testing/factories.rb
push_type_core-0.1.1 lib/push_type/testing/factories.rb
push_type_core-0.1.0 lib/push_type/testing/factories.rb
push_type_core-0.1.0.beta3 lib/push_type/testing/factories.rb