[rspec-users] oddness with messages_path

Cynthia Kiser cnk at ugcs.caltech.edu
Sat Nov 26 22:03:53 EST 2011

Quoting Patrick J. Collins <patrick at collinatorstudios.com>:
> > I can work around it by constructing the url myself with
> > "/messages/#{message.id}" but I am curious where the period is coming
> > from in the constructed url. 
> It's because you should be using a singular resource name to signify that you
> are updating an existing record.  I believe you want to do
> "message_path(message)" instead of "messages_path(message)"

D'ho! Exactly right. I am still mystified by the way in which this
fails but the problem is indeed that I needed to use
message_path. That works with (message) and with (message.id). 

And this is Rails 3.1.3 and rspec 2.7.0, rspec-core 2.7.1, and
rspec-rails 2.7.0. 
Cynthia N. Kiser
cnk at ugcs.caltech.edu

More information about the rspec-users mailing list