Sha256: 0fe61f65c40205a475041a11d5e7eb55e2dd5a851fdcbafcfe9c2b13824055bc

Contents?: true

Size: 455 Bytes

Versions: 10

Compression:

Stored size: 455 Bytes

Contents

require 'spec_helper'
require 'acceptance/acceptance_helper'

describe "default strategy" do
  it "uses create when not specified" do
    define_model('User')

    FactoryGirl.define do
      factory :user
    end

    Factory(:user).should_not be_new_record
  end

  it "can be overridden" do
    define_model('User')

    FactoryGirl.define do
      factory :user, :default_strategy => :build
    end

    Factory(:user).should be_new_record
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
factory_girl-2.0.4 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.3 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.2 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.1 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.0.rc4 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.0.rc3 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.0.rc2 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.0.rc1 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.0.beta5 spec/acceptance/default_strategy_spec.rb
factory_girl-2.0.0.beta4 spec/acceptance/default_strategy_spec.rb