Sha256: 6621e6d02469321964a69753ed0dba26029591ef1f46b8bf838352b35a4681ff

Contents?: true

Size: 487 Bytes

Versions: 39

Compression:

Stored size: 487 Bytes

Contents

require "spec_helper"

describe "defining a child factory before a parent" do
  before do
    define_model("User", :name => :string, :admin => :boolean, :email => :string, :upper_email => :string, :login => :string)

    FactoryGirl.define do
      factory :admin, :parent => :user do
        admin true
      end

      factory :user do
        name "awesome"
      end
    end
  end

  it "creates admin factories correctly" do
    FactoryGirl.create(:admin).should be_admin
  end
end

Version data entries

39 entries across 34 versions & 3 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/factory_girl-2.6.4/spec/acceptance/define_child_before_parent_spec.rb
challah-0.6.2 vendor/bundle/gems/factory_girl-2.6.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.6.1 vendor/bundle/gems/factory_girl-2.6.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.6.1 vendor/bundle/gems/factory_girl-2.5.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.6.0 vendor/bundle/gems/factory_girl-2.6.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.6.0 vendor/bundle/gems/factory_girl-2.5.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.5.4 vendor/bundle/gems/factory_girl-2.6.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.5.4 vendor/bundle/gems/factory_girl-2.5.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.5.3 vendor/bundle/gems/factory_girl-2.5.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.5.3 vendor/bundle/gems/factory_girl-2.6.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.5.2 vendor/bundle/gems/factory_girl-2.5.1/spec/acceptance/define_child_before_parent_spec.rb
challah-0.5.2 vendor/bundle/gems/factory_girl-2.6.1/spec/acceptance/define_child_before_parent_spec.rb
factory_girl-2.6.4 spec/acceptance/define_child_before_parent_spec.rb
factory_girl-2.6.3 spec/acceptance/define_child_before_parent_spec.rb
factory_girl-2.6.2 spec/acceptance/define_child_before_parent_spec.rb
challah-0.5.1 vendor/bundle/gems/factory_girl-2.6.1/spec/acceptance/define_child_before_parent_spec.rb
factory_girl-2.6.1 spec/acceptance/define_child_before_parent_spec.rb
challah-0.5.0 vendor/bundle/gems/factory_girl-2.5.1/spec/acceptance/define_child_before_parent_spec.rb
factory_girl-2.6.0 spec/acceptance/define_child_before_parent_spec.rb
factory_girl-2.5.2 spec/acceptance/define_child_before_parent_spec.rb