thoughtbot/factory_girl — Issue #274: Consider undeprecating attributes_for
Author: subelsky
Created: 2012-01-18 15:37:14+00:00
State: open

Please undeprecate attributes_for? This syntax is extremely useful to me, and your suggested hack (Factory.build(:user).attributes) does not work for me. I have a controller spec roughly like this:

````ruby
MyClass.should_not_receive(:new)
post :create, my_class: Factory.build(:my_class,params).attributes
# fails because you're forcing me to call MyClass.new to setup the test
````

Besides this problem, `attributes` returns a bunch of stuff not needed in a scenario like that (such as `created_at`, `updated_at`, etc).

I love FactoryGirl so please don't take this as a criticism. I just really rely on attributes_for and I would probably have to create a private fork if you remove this *essential* feature.