Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Nov 18, 2011
  1. @joshuaclayton

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

    joshuaclayton authored
    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")
Commits on Nov 9, 2011
  1. @gabebw

    Use correct module in docs.

    gabebw authored
Commits on Oct 31, 2011
  1. @agronemann @joshuaclayton

    Fixing typo in GETTING_STARTED.md

    agronemann authored joshuaclayton committed
Commits on Oct 14, 2011
  1. @justinko @joshuaclayton
Commits on Oct 9, 2011
  1. @joshuaclayton

    Change syntax for ignoring attributes to use block syntax instead of

    joshuaclayton authored
    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
Commits on Sep 23, 2011
  1. @joshuaclayton

    Introduce declarations

    Joe Ferris and Josh Clayton authored joshuaclayton committed
    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
Commits on Sep 16, 2011
  1. @gabebw
Commits on Sep 15, 2011
  1. @ovargas27
  2. @ovargas27
Commits on Sep 6, 2011
  1. @joshuaclayton
  2. @gabebw

    typo

    gabebw authored
  3. @gabebw
Commits on Sep 2, 2011
  1. @joshuaclayton
  2. @joshuaclayton

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

    Stephan Eckardt and Josh Clayton authored joshuaclayton committed
    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.
Commits on Sep 1, 2011
  1. @joshuaclayton
Commits on Aug 30, 2011
  1. @gabebw

    Fix formatting.

    gabebw authored
Commits on Aug 26, 2011
  1. @mike-burns
Commits on Aug 25, 2011
  1. Now able to specify :method => :build in a factory's association.

    Jim Kingdon authored
    See issue #64.
  2. @betelgeuse
Commits on Aug 20, 2011
  1. @joshuaclayton

    Add transient variables

    joshuaclayton authored
    Closes #142
    Closes #103
Commits on Aug 17, 2011
  1. @tomstuart
Commits on Aug 12, 2011
  1. @joshuaclayton
  2. @joshuaclayton
Commits on Jul 28, 2011
  1. @gabebw
Commits on Jul 25, 2011
  1. @huerlisi
Commits on Jul 4, 2011
  1. @joshuaclayton
Commits on Jul 1, 2011
  1. @joshuaclayton

    More docs

    joshuaclayton authored
  2. @joshuaclayton

    Documentation fixes

    joshuaclayton authored
Commits on Jun 29, 2011
  1. @joshuaclayton
  2. @r00k
  3. @joshuaclayton

    Whitespace

    joshuaclayton authored
Commits on Jun 28, 2011
  1. @pythonandchips @joshuaclayton
Commits on Jun 27, 2011
  1. @joshuaclayton
Commits on Feb 7, 2011
  1. @jferris

    Extract examples out to a different file so that the readme people se…

    jferris authored
    …e on Github won't contact examples from master
Something went wrong with that request. Please try again.