[rspec-users] errors while testing resource controller using rpec
deepak.jois at gmail.com
Tue Jan 30 03:47:38 EST 2007
On 1/30/07, Deepak Jois <deepak.jois at gmail.com> wrote:
> however, If I change the mock stub to return a string, the spec passes fine.
> @mock_venue.stub!(:to_param).and_return("1") # note the string
> There is something happening in the generated code venue_url which I
> am not aware of, which is causing the test to fail on the mock object.
According to http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001033
the to_param method sends a stringified ID. Hence this should be a bug.
More information about the rspec-users