Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Apr 26, 2013
  1. @joshuaclayton

    Idea for association syntax within dynamic attributes

    joshuaclayton authored
    Breaks in older (3.0, not sure about 3.1) versions of Rails due to how
    association assignment is handled.
    Problems: order of block variables is reversed between dynamic
    attributes and callbacks. If adding this, I'd prefer to maintain order.
    Current implementation handles this by, when one block variable,
    treating as evaluator like normal. When two are provided, the instance
    becomes the first and the second is the evaluator. Not sure how
    confusing that is, though.
  2. @olivierlacan @joshuaclayton

    Add an example of a trait used within a trait

    olivierlacan authored joshuaclayton committed
    Closes #518
  3. @joshuaclayton

    Raise if a method is defined with a FactoryGirl block (factory or trait)

    joshuaclayton authored
    This resolves an issue where users have defined methods inside factory
    girl blocks. This hasn't worked in quite a while and without raising,
    users would be able to define methods and see an odd error (a
    NoMethodError for `singleton_method_added=`). Instead, we raise
    immediately so that no issues come up later when they actually try to
    use the factories.
    Closes #513
Commits on Apr 5, 2013
  1. @releu @joshuaclayton

    Allow use of Symbol#to_proc in FactoryGirl callbacks

    releu authored joshuaclayton committed
    This allows callbacks to be called as such:
        FactoryGirl.define do
          factory :user do
            after :create, &:confirm!
    Closes #511
Commits on Mar 25, 2013
  1. @joshuaclayton
Commits on Feb 17, 2013
  1. @dpickett @joshuaclayton

    change reference from 'next' to 'generate'

    dpickett authored joshuaclayton committed
  2. @dpickett @joshuaclayton

    probable typo - missing interpolation #

    dpickett authored joshuaclayton committed
Commits on Feb 8, 2013
  1. @joshuaclayton

    Add global callbacks

    joshuaclayton authored
    This allows callbacks (after :build, :create, etc.) to be defined at the
    FactoryGirl level; this means that the callback will be invoked for all
    factories. This is primarily to maintain consistency and follow the
    principle of least surprise.
    As usual, callbacks are applied from the lowest component to the
    highest, meaning that global callbacks will be run after factory and
    trait callbacks are run.
        FactoryGirl.define do
          after(:build) {|object| puts "Built #{object}" }
          factory :user
          # ...
    Closes #481
    Closes #486
  2. @joshuaclayton

    Add Code Climate badge

    joshuaclayton authored
Commits on Jan 29, 2013
  1. @mjankowski
  2. @jordimassaguerpla @joshuaclayton

    add license information to gemspec

    jordimassaguerpla authored joshuaclayton committed
    This way it can be used with API
Commits on Jan 18, 2013
  1. @joshuaclayton

    Bump version to 4.2.0

    joshuaclayton authored
  2. @joshuaclayton
  3. @joshuaclayton
  4. @joshuaclayton

    Convert to expect syntax

    joshuaclayton authored
  5. @joshuaclayton

    Fix warnings

    joshuaclayton authored
    [Closes #463]
  6. @joshuaclayton
  7. @joshuaclayton

    Evaluate sequences within the context of the Evaluator when possible

    Derek Prior and Josh Clayton authored joshuaclayton committed
    This fixes weird issues where methods invoked within sequences
    (like `sprintf`) fail because these methods are being evaluated within
    the context of the DefinitionProxy. With this change, invoking `#next`
    on a sequence happens from the evaluator so if the scope is provided (it
    usually will be), it'll run in the proper context. This means a couple
    of oddities are fixed:
    1. Developers can now refer to methods on the object instance, just like
    in dynamic attributes:
        class User
          def company
            # company lookup
        FactoryGirl.define do
          factory :user do
            sequence(:job_title) {|n| "{title} #{n} at #{}" }
    2. Invoke methods typically available because the method is available on
    Object (e.g. Kernel methods):
        FactoryGirl.define do
          factory :user do
            sequence(:last_4_ssn) {|n| sprintf '%04d', n }
Commits on Jan 4, 2013
  1. @mjankowski
  2. @mjankowski
Commits on Dec 21, 2012
  1. @aripollak @joshuaclayton

    Match build_stubbed's created_at type to ActiveRecord

    aripollak authored joshuaclayton committed
    Closes #469
  2. @sikachu
Commits on Nov 7, 2012
  1. @joshuaclayton
  2. @joshuaclayton
Commits on Nov 2, 2012
  1. @joshuaclayton
  2. @joshuaclayton
  3. @joshuaclayton
  4. @hosamaly @joshuaclayton

    Re: #431 -- Added a note about `strategy: :build`

    hosamaly authored joshuaclayton committed
Commits on Oct 29, 2012
  1. @stve
Commits on Oct 22, 2012
  1. @jferris @joshuaclayton

    Refactor spec to avoid a general fixture

    jferris authored joshuaclayton committed
    * Removes let blocks
    * Introduces factory methods for common test setup
  2. @pjg @joshuaclayton

    Two typos fix in GETTING_STARTED

    pjg authored joshuaclayton committed
  3. @bbugh @joshuaclayton
Commits on Sep 28, 2012
  1. @phlipper
Commits on Sep 14, 2012
  1. Update copyright years in and LICENSE

    Adarsh Pandit authored
  2. @joshuaclayton
Something went wrong with that request. Please try again.