parent
4e2a672b9e
commit
24d417d575
|
@ -64,6 +64,6 @@ module FactoryGirl
|
|||
end
|
||||
|
||||
def self.callback_names
|
||||
[:after_build, :after_create, :after_stub].freeze
|
||||
[:after_build, :after_create, :after_stub, :before_create].freeze
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,6 +8,7 @@ module FactoryGirl
|
|||
def result(attribute_assigner, to_create)
|
||||
attribute_assigner.object.tap do |result_instance|
|
||||
run_callbacks(:after_build, result_instance)
|
||||
run_callbacks(:before_create, result_instance)
|
||||
to_create[result_instance]
|
||||
run_callbacks(:after_create, result_instance)
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'spec_helper'
|
|||
|
||||
describe FactoryGirl::Strategy::Create do
|
||||
it_should_behave_like "strategy with association support", FactoryGirl::Strategy::Create
|
||||
it_should_behave_like "strategy with callbacks", :after_build, :after_create
|
||||
it_should_behave_like "strategy with callbacks", :after_build, :before_create, :after_create
|
||||
|
||||
it "runs a custom create block" do
|
||||
block_run = false
|
||||
|
|
Loading…
Reference in New Issue