On Tue, Feb 7, 2012 at 4:11 AM, Patrick J. Collins
wrote:
>> Sorry, too quick to answer.
>> Next clue is the fact that the RSpec error is ignoring your id attribute.
>> try:
>> post :share, :id => 42
>> and see if that gets you past the current error
>
> Yeah-- Unfortunatley I also had tried this
> Sorry, too quick to answer.
> Next clue is the fact that the RSpec error is ignoring your id attribute.
> try:
> post :share, :id => 42
> and see if that gets you past the current error
Yeah-- Unfortunatley I also had tried this and got the same result...
Patrick J. Collins
http://collinatorst
Sorry, too quick to answer.
Next clue is the fact that the RSpec error is ignoring your id attribute. try:
post :share, :id => 42
and see if that gets you past the current error
Andrew
On Tuesday 07 February 2012 at 7:05 AM, Patrick J. Collins wrote:
> I tried that and got the same result, plus
On Feb 6, 2012, at 6:45 PM, Patrick J. Collins wrote:
> I've got a share method in my controller, and I have the following spec:
>
> describe PostsController do
>
>describe "#share" do
>
> it "doesn't blow up" do
>post :share, :id => @post.id
Does @post actually have an id?
I tried that and got the same result, plus rake routes says:
share_post POST /posts/:id/share(.:format) {:action=>"share",
:controller=>"posts"}
NOT
share_post POST /posts/:post_id/share(.:format) {:action=>"share",
:controller=>"posts"}
So I don't see how that can be the case...
Patrick
The id belongs to post so your test line should be:
post :share, :post_id => @post.id
Andrew
On Tuesday 07 February 2012 at 3:45 AM, Patrick J. Collins wrote:
> I've got a share method in my controller, and I have the following spec:
>
> describe PostsController do
>
> describe "#share" do