Friday, December 17, 2010

rspec and object assignment

In rails console I can say

ob = JoinObject.new(:join_a => @a, :join_b => @b)

And all is well.
In rspec (I have: gem 'rspec-rails', '>=2.2.0' in my Gemfile) I need to use the _id to make it work

ob = JoinObject.new(:join_a_id => @a.id, :join_b_id => @b.id)

Any light to be shed?

No comments:

Post a Comment