Skip to content
This repository

Feb 17, 2012

  1. Joshua Clayton

    Fix ignored attribute name

    joshuaclayton authored
  2. Joshua Clayton

    Add tests and documentation for has_many relationships

    joshuaclayton authored
  3. Joshua Clayton

    Deprecate :method in favor of :strategy

    joshuaclayton authored

Feb 10, 2012

  1. Joshua Clayton

    Proxy => Strategy

    joshuaclayton authored

Feb 08, 2012

  1. Simone Carletti

    Document build_list and create_list with runtime traits.

    weppos authored joshuaclayton committed

Jan 29, 2012

  1. Carlos Antonio da Silva

    Change getting started doc to remove old "FactoryGirl.stub" method

Jan 23, 2012

  1. Joe Ferris

    Update README with more to_initialize info

    jferris authored

Jan 20, 2012

  1. Joshua Clayton

    Implement initialize_with to allow overriding object instantiation

    Factory Girl now allows factories to override object instantiation. This
    means factories can use factory methods (e.g. methods other than new) as
    well as pass arguments explicitly.
    
        factory :user do
          ignore do
            things { ["thing 1", "thing 2"] }
          end
    
          initialize_with { User.construct_with_things(things) }
        end
    
        factory :report_generator do
          ignore do
            name { "Generic Report" }
            data { {:foo => "bar", :baz => "buzz"} }
          end
    
          initialize_with { ReportGenerator.new(name, data) }
        end
    
    Whitespace
    
    Code recommendations
    joshuaclayton authored

Jan 13, 2012

  1. Daniel Schierbeck

    Make the examples use Ruby syntax highlighting on GitHub.

    dasch authored joshuaclayton committed

Nov 18, 2011

  1. Joshua Clayton

    Traits can be added to factories when the factory creates an instance

    This allows for traits to be used with normal factories without having
    to name every single factory that uses one (or many) traits.
    
    So, instead of creating male_admin and female_admin factories:
    
        FactoryGirl.define do
          factory :user do
            trait(:admin)  { admin true }
            trait(:male)   { gender "Male" }
            trait(:female) { gender "Female" }
    
            factory :male_admin,   :traits => [:male, :admin]
            factory :female_admin, :traits => [:admin, :female]
          end
        end
    
        FactoryGirl.create(:male_admin)
        FactoryGirl.create(:female_admin)
    
    You could just create a user with those traits assigned:
    
        FactoryGirl.create(:user, :admin, :male)
        FactoryGirl.create(:user, :admin, :female)
    
    This can be combined with attribute overrides as expected.
    
        FactoryGirl.create(:user, :admin, :male,   :name => "John Doe")
        FactoryGirl.create(:user, :admin, :female, :name => "Jane Doe")
    joshuaclayton authored

Nov 09, 2011

  1. Gabe Berke-Williams

    Use correct module in docs.

    gabebw authored

Oct 31, 2011

  1. Alexander Gronemann

    Fixing typo in GETTING_STARTED.md

    agronemann authored joshuaclayton committed

Oct 14, 2011

  1. Justin Ko

    Calling the syntax methods with a block yields the return object. Clo…

    …ses #210
    justinko authored joshuaclayton committed

Oct 09, 2011

  1. Joshua Clayton

    Change syntax for ignoring attributes to use block syntax instead of

    calling ignore on individual declarations.
    
    Old syntax:
    
        factory :user do
          rockstar(true).ignore
          four { 2 + 2 }.ignore
    
          name { "John Doe#{" - Rockstar" if rockstar}" }
        end
    
    New syntax:
    
        factory :user do
          ignore do
            rockstar true
            four     { 2 + 2 }
          end
    
          name { "John Doe#{" - Rockstar" if rockstar}" }
        end
    joshuaclayton authored

Sep 23, 2011

  1. Introduce declarations

    Declarations are another layer of abstraction between defining the
    factories via the DSL and compiling the factories and their attributes.
    
    Declarations know how to return their attribute(s), and running a
    factory compiles the declarations before building all attributes on the
    factory. This moves all the attribute compilation logic into one
    centralized location on the Factory instance, which means traits (and
    potentially other features down the road) can have individual attributes
    overridden within child factories or through FactoryGirl.modify
    
    Closes #205
    Joe Ferris and Josh Clayton authored joshuaclayton committed

Sep 16, 2011

  1. Gabe Berke-Williams

    Whitespace, textwidth, and escaping underscores.

    gabebw authored

Sep 15, 2011

  1. Omar

    Even more specific instructions for cucumber integration

    ovargas27 authored
  2. Omar

    More specific instructions for cucumber integration

    ovargas27 authored

Sep 06, 2011

  1. Joshua Clayton

    Update Getting Started to reflect recent version bumps

    joshuaclayton authored
  2. Gabe Berke-Williams

    typo

    gabebw authored
  3. Gabe Berke-Williams

    factory_girl_rails 1.1 isn't an RC

    gabebw authored

Sep 02, 2011

  1. Joshua Clayton

    Clarify factory modification in the context of traits

    joshuaclayton authored
  2. Allow factories to be modified after they've been defined.

    This adds `FactoryGirl.modify`, which allows for reopening of factories
    that've been defined elsewhere. Modifying a factory won't remove or
    change callbacks, only attributes.
    Stephan Eckardt and Josh Clayton authored joshuaclayton committed

Sep 01, 2011

  1. Joshua Clayton

    Fix documentation to reference build_stubbed instead of stub

    joshuaclayton authored

Aug 30, 2011

  1. Gabe Berke-Williams

    Fix formatting.

    gabebw authored

Aug 26, 2011

  1. Mike Burns

    Merge branch 'method-build2-0-5' of https://github.com/jkingdon/facto…

    mike-burns authored

Aug 25, 2011

  1. Now able to specify :method => :build in a factory's association.

    See issue #64.
    Jim Kingdon authored
  2. Petteri Räty

    Typo fix possbile to possible

    betelgeuse authored

Aug 20, 2011

  1. Joshua Clayton

    Add transient variables

    Closes #142
    Closes #103
    joshuaclayton authored

Aug 17, 2011

  1. Tom Stuart

    Replace Factory.next with FactoryGirl.generate in Getting Started guide

    tomstuart authored

Aug 12, 2011

  1. Joshua Clayton

    Rename attribute groups to traits

    joshuaclayton authored
  2. Joshua Clayton

    Document attribute groups

    joshuaclayton authored

Jul 28, 2011

  1. Gabe Berke-Williams

    Edited GETTING_STARTED.md via GitHub

    gabebw authored

Jul 25, 2011

  1. Simon Hürlimann

    Update getting started documentation to drop release candidate versio…

    …ns in Gemfile.
    huerlisi authored

Jul 04, 2011

  1. Joshua Clayton

    Update getting started doc to outline updating gemfile

Something went wrong with that request. Please try again.