1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/spec/acceptance
Joshua Clayton 36cb43e9b0 Add global callbacks
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
      # ...
    end

Closes #481
Closes #486
2013-02-08 11:24:35 -05:00
..
activesupport_instrumentation_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
aliases_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
attribute_aliases_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
attribute_existing_on_object_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
attributes_for_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
attributes_from_instance_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
attributes_ordered_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
build_list_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
build_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
build_stubbed_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
callbacks_spec.rb Add global callbacks 2013-02-08 11:24:35 -05:00
create_list_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
create_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
define_child_before_parent_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
definition_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
definition_without_block_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
global_initialize_with_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
global_to_create_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
initialize_with_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
keyed_by_class_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
modify_factories_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
modify_inherited_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
nested_attributes_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
overrides_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
parent_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
register_strategies_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
sequence_context_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
sequence_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
skip_create_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
stub_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
syntax_methods_within_dynamic_attributes_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
traits_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00
transient_attributes_spec.rb Convert to expect syntax 2013-01-18 13:58:36 -05:00