Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Jul 14, 2012

  1. Prem Sichanugrist

    Fix FactoryGirl naming convention

    So now, we'll always refer to this Gem as FactoryGirl, regardless of
    context. This commit is to make it consistence throughout the code base.
    sikachu authored joshuaclayton committed

Jul 12, 2012

  1. Joshua Clayton

    Add DefinitionHierarchy to handle inheritance of some definition attr…

    …ibutes
    
    This includes #callbacks, #constructor, and #to_create. The reasoning
    behind this is that we were mimicing an inheritance chain via methods;
    now, we actually generate classes, which Factory maintains, who inherit
    from their parent's hierarchy. We build the hierarchy during compilation
    to conditionally define methods based on whether what we're dealing
    with from the definition is actually meaningful. The base class
    (DefinitionHierarchy) uses the defaults (an empty array for #callbacks
    and the global #to_create and #constructor) so once we hit the top
    level, if the definition doesn't set any overrides, we have a list of
    sensible values.

Jul 07, 2012

  1. Joshua Clayton

    Don't actually advocate using Faker to generate test data

Jun 29, 2012

  1. Joshua Clayton

    Allow factories with traits to be used in associations

    This allows defining associations with factories using traits by slicing
    up the hash passed to association. Passing an array to `:factory` will
    use the first item in the array as the factory, with any subsequent
    symbols as traits.
    
    Here's an example:
    
        factory :post do
          association :author, factory: [:user, :admin], name: 'John Doe'
        end
    
    Closes #395

Jun 25, 2012

  1. Joshua Clayton

    Follow pattern for raising when instantiating

  2. Joshua Clayton

    Link to blog post outlining step definition deprecation

Jun 22, 2012

  1. Joshua Clayton

    Move Timecop.return to global after

  2. Joshua Clayton

    Bump version to 3.5.0

  3. Joshua Clayton

    Allow created_at to be set when using build_stubbed

    Closes #390
  4. Joshua Clayton

    Deprecate FactoryGirl step definitions

Jun 20, 2012

  1. Joshua Clayton

    Fix date in NEWS

  2. Joshua Clayton

    Bump version to 3.4.2

  3. Joshua Clayton

    Ensure that callbacks are triggered once for implicit traits

    Closes #393

Jun 19, 2012

  1. Joshua Clayton

    Add documentation about how to use FG without Rails/Bundler

    Closes #391

Jun 18, 2012

  1. Joshua Clayton

    Bump version to 3.4.1

Jun 16, 2012

  1. Joshua Clayton

    Fix various trait bugs so traits can be used within each other

    The previous implementation of trait handling within the Definition
    didn't account for when implicit traits were used within other traits.
    This is useful if you have two different traits, but one depends on
    another; for example, a refunded order and a completed order could both
    have the attribute `completed_at` set, but refunded would additionally
    have `refunded_at` set:
    
        FactoryGirl.define do
          factory :order do
            trait :completed do
              completed_at { 3.days.ago }
            end
    
            trait :refunded do
              completed
              refunded_at { 1.day.ago }
            end
          end
        end
    
    This also tests to make sure that callbacks, custom constructors, and
    creation overrides work correctly when implicit traits are used within
    other traits.
    
    Fixes #360

Jun 12, 2012

  1. Joshua Clayton

    Don't mutate hash

Jun 11, 2012

  1. Joshua Clayton

    Bump version to 3.4.0

Jun 09, 2012

  1. Joshua Clayton

    Support refering to factory based on class name

    Allows for build/creating based on RSpec's described_class, useful since
    we've deprecated other syntaxes from FG.
    
    Closes #386

Jun 08, 2012

  1. Joshua Clayton

    Move DisallowsDuplicatesRegistry to a decorator

  2. Joshua Clayton

    Refer to the correct attribute

  3. Joshua Clayton

    Make hash of public attributes available within the initialize_with b…

    …lock
    
    Closes #344
  4. Joshua Clayton

    Fix namespace issues in 1.9.2

May 18, 2012

  1. Joshua Clayton

    Get spec passing on 1.9.2

  2. Joshua Clayton

    Optionally disable duplicate assignment of attributes in initialize_with

    By setting:
    
        FactoryGirl.duplicate_attribute_assignment_from_initialize_with =
    false
    
    This turns off duplicate assignment of attributes accessed from
    initialize_with. This means any attributes accessed from the factory and
    assigned in the initialize_with block won't be subsequently set after
    the object has been instantiated.
    
    This will be the default functionality in 4.0.
    
    Closes #345
  3. Joshua Clayton

    Remove unnecessary conditional in Evaluator#method_missing

    Evaluator has all methods defined dynamically; this includes standard
    attributes AND overrides. Because of this, method_missing never actually
    gets used to retrieve a value from previously declared attributes or
    overrides.
    
    This branch of logic was never accessed

May 13, 2012

  1. Joshua Clayton

    Sequences support Enumerators

    This introduces an EnumeratorAdapter so everything coming in looks like
    an Enumerator. It doesn't use the adapter if the #peek method exists on
    the object.
    
    This allows for sequences like:
    
        sequence(:cities, %w[Boston Atlanta Detroit Seattle].cycle)
    
    This also makes it easier to cycle through arrays and ranges, since they
    can be converted to Enumerators rather easily.
    
        sequence(:month, (1..12).to_enum)
        sequence(:month, %w[foo bar baz].to_enum)
    
    This doesn't handle when calling Range#step out of the box, because
    Ruby returns an Enumerator but ActiveSupport 3.x returns an array,
    meaning #to_enum still needs to be called.
    
    Closes #339, #378
  2. Joshua Clayton

    Bump version to 3.3.0

May 12, 2012

  1. Joshua Clayton

    Styles

  2. Joshua Clayton

    Allow initialize_with defined for all factories

    This allows users to define initialize_with for every factory run through
    factory_girl.
    
        FactoryGirl.define do
          initialize_with { new("John Doe") }
        end
    
    If you want to override this default, set it per factory or in a trait
    (and include the trait).
    
    Closes #342
  3. Joshua Clayton

    Allow to_create defined for all factories

    This allows users to define to_create for every factory run through
    factory_girl.
    
        FactoryGirl.define do
          to_create {|instance| instance.persist! }
        end
    
    If you want to override this default, set it per factory or in a trait
    (and include the trait).
    
    Closes #341
  4. Joshua Clayton

    Move registries to configuration

May 11, 2012

  1. Joshua Clayton

    Remove duplicate compiled_to_create method

  2. Joshua Clayton

    Fix initialize_with in the context of traits

  3. Joshua Clayton

    Fix to_create so it works when defined in a trait

Something went wrong with that request. Please try again.