Sha256: 03479a8a681d3dc1fa96654fc1e68abe9e7f8b71702b3881ccc938dabea9c459

Contents?: true

Size: 473 Bytes

Versions: 16

Compression:

Stored size: 473 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
    expect(FactoryGirl.create(:admin)).to be_admin
  end
end

Version data entries

16 entries across 13 versions & 5 rubygems

Version Path
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/factory_girl-4.5.0/spec/acceptance/define_child_before_parent_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/factory_girl-4.5.0/spec/acceptance/define_child_before_parent_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/factory_girl-4.5.0/spec/acceptance/define_child_before_parent_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/factory_girl-4.5.0/spec/acceptance/define_child_before_parent_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/spec/acceptance/define_child_before_parent_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/spec/acceptance/define_child_before_parent_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/spec/acceptance/define_child_before_parent_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/spec/acceptance/define_child_before_parent_spec.rb
factory_girl-4.5.0 spec/acceptance/define_child_before_parent_spec.rb
factory_girl-4.4.0 spec/acceptance/define_child_before_parent_spec.rb
factory_girl-4.3.0 spec/acceptance/define_child_before_parent_spec.rb
challah-1.0.0 vendor/bundle/gems/factory_girl-4.2.0/spec/acceptance/define_child_before_parent_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/factory_girl-4.2.0/spec/acceptance/define_child_before_parent_spec.rb
challah-1.0.0.beta2 vendor/bundle/gems/factory_girl-4.2.0/spec/acceptance/define_child_before_parent_spec.rb
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.2.0/spec/acceptance/define_child_before_parent_spec.rb
factory_girl-4.2.0 spec/acceptance/define_child_before_parent_spec.rb