From c57b31d7368ad898aaf548a9888c2fcbe4756c05 Mon Sep 17 00:00:00 2001 From: Jim Deville Date: Fri, 6 Jul 2012 13:03:19 -0700 Subject: [PATCH] Add with! to create the target non-lazily --- lib/factory_girl/rspec/with.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/factory_girl/rspec/with.rb b/lib/factory_girl/rspec/with.rb index fd42a68..0ad1759 100644 --- a/lib/factory_girl/rspec/with.rb +++ b/lib/factory_girl/rspec/with.rb @@ -6,6 +6,10 @@ module With def with(name, options = {}) let(name) { ::FactoryGirl.create(name, options) } end + + def with!(name, options = {}) + let!(name) { ::FactoryGirl.create(name, options) } + end end end end