Home > Development > Factory Girl stringify_keys error in Create Test

Factory Girl stringify_keys error in Create Test

I was getting the following error while trying to test the create method of a controller using factory_girl and shoulda:

NoMethodError: undefined method `stringify_keys!`

The error was that I am sending an object to the create method, which actually requires a hash of attributes… the solution is to use factory_girl’s attributes_for method.

Hope this helps!

Categories: Development Tags: ,
  1. No comments yet.
  1. No trackbacks yet.