[rspec-users] oddness with messages_path

2011-11-26 Thread Cynthia Kiser
I am working through the Rails Views chapter in the RSpec Book and noticed something odd when I created a spec for the edit view. I am getting the wrong value from the messages_path helper. I was kind of wondering if it would work or not - but had expected it to fail by not giving me an id, not by

Re: [rspec-users] oddness with messages_path

2011-11-26 Thread David Chelimsky
On Nov 26, 2011, at 2:38 PM, Cynthia Kiser wrote: > I am working through the Rails Views chapter in the RSpec Book and > noticed something odd when I created a spec for the edit view. I am > getting the wrong value from the messages_path helper. I was kind of > wondering if it would work or not -

Re: [rspec-users] oddness with messages_path

2011-11-26 Thread Patrick J. Collins
> 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 d

Re: [rspec-users] oddness with messages_path

2011-11-26 Thread Cynthia Kiser
Quoting Patrick J. Collins : > > 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

Re: [rspec-users] oddness with messages_path

2011-11-26 Thread Justin Ko
On Nov 26, 2011, at 8:03 PM, Cynthia Kiser wrote: > Quoting Patrick J. Collins : >>> 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 singu

Re: [rspec-users] oddness with messages_path

2011-11-26 Thread Cynthia Kiser
Quoting Justin Ko : > Run "rake routes" and you'll see what the two "paths" generate. Rake routes didn't really give me much insight - but playing around in the console did. Any argument to messages_path gets interpreted as a format - even an integer. > app.messages_path(:pdf) => "/messages.pd