Sha256: bb79dc86bf66ed7cee59c6d709a4c661304254c13e19416606a1c5b3216dd1e0

Contents?: true

Size: 394 Bytes

Versions: 201

Compression:

Stored size: 394 Bytes

Contents

require "spec_helper"

describe "aliases and overrides" do
  before do
    FactoryGirl.aliases << [/one/, "two"]

    define_model("User", two: :string, one: :string)

    FactoryGirl.define do
      factory :user do
        two "set value"
      end
    end
  end

  subject { FactoryGirl.create(:user, one: "override") }
  its(:one) { should == "override" }
  its(:two) { should be_nil }
end

Version data entries

201 entries across 93 versions & 7 rubygems

Version Path
factory_girl-3.5.0 spec/acceptance/aliases_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/factory_girl-3.2.0/spec/acceptance/aliases_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/factory_girl-3.3.0/spec/acceptance/aliases_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/factory_girl-3.2.0/spec/acceptance/aliases_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/factory_girl-3.3.0/spec/acceptance/aliases_spec.rb
factory_girl-3.4.2 spec/acceptance/aliases_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/factory_girl-3.2.0/spec/acceptance/aliases_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/factory_girl-3.3.0/spec/acceptance/aliases_spec.rb
factory_girl-3.4.1 spec/acceptance/aliases_spec.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/factory_girl-3.2.0/spec/acceptance/aliases_spec.rb
factory_girl-3.4.0 spec/acceptance/aliases_spec.rb
classiccms-0.3.8 vendor/bundle/gems/factory_girl-3.3.0/spec/acceptance/aliases_spec.rb
classiccms-0.3.8 vendor/bundle/gems/factory_girl-3.2.0/spec/acceptance/aliases_spec.rb
classiccms-0.3.8 vendor/bundle/gems/factory_girl-3.0.0/spec/acceptance/aliases_spec.rb
challah-0.6.1 vendor/bundle/gems/factory_girl-3.3.0/spec/acceptance/aliases_spec.rb
challah-0.6.1 vendor/bundle/gems/factory_girl-3.0.0/spec/acceptance/aliases_spec.rb
classiccms-0.3.7 vendor/bundle/gems/factory_girl-3.2.0/spec/acceptance/aliases_spec.rb
classiccms-0.3.7 vendor/bundle/gems/factory_girl-3.3.0/spec/acceptance/aliases_spec.rb
classiccms-0.3.7 vendor/bundle/gems/factory_girl-3.0.0/spec/acceptance/aliases_spec.rb
classiccms-0.3.6 vendor/bundle/gems/factory_girl-3.0.0/spec/acceptance/aliases_spec.rb