Forum: RSpec route_for

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Yi W. (Guest)
on 2009-03-09 05:09
(Received via mailing list)
Get restful-authentication and rspec trunk from github. And a couple
tests
fail. One of them is this assertion:

route_for(:controller => 'users', :action => 'destroy', :id =>
'1').should
== "/users/1"

error msg is:

should route users's 'destroy' action correctly

The recognized options <{"action"=>"show", "id"=>"1",
"controller"=>"users"}> did not match <{"action"=>"destroy", "id"=>"1",
"controller"=>"users"}>, difference: <{"action"=>"destroy"}>

But  assert_generates from rails works fine.

I myself never used route_for helper before. So I am not sure is this is
the
problem of the method, or restful_authentication author misused it, or
rails
2.3RC2 breaks it.

Thanks

Yi
David C. (Guest)
on 2009-03-09 06:04
(Received via mailing list)
On Sun, Mar 8, 2009 at 9:49 PM, Yi <removed_email_address@domain.invalid> wrote:
> The recognized options <{"action"=>"show", "id"=>"1",
> "controller"=>"users"}> did not match <{"action"=>"destroy", "id"=>"1",
> "controller"=>"users"}>, difference: <{"action"=>"destroy"}>
>
> But  assert_generates from rails works fine.
>
> I myself never used route_for helper before. So I am not sure is this is the
> problem of the method, or restful_authentication author misused it, or rails
> 2.3RC2 breaks it.

Actually, it's rspec's edge that breaks it, documented here:

http://github.com/dchelimsky/rspec-rails/blob/mast...

Somebody should probably offer up a patch to restful_authentication.
I'll do it unless anybody else cares to volunteer.

Cheers,
David
David C. (Guest)
on 2009-03-09 06:31
(Received via mailing list)
On Sun, Mar 8, 2009 at 10:15 PM, David C. <removed_email_address@domain.invalid>
wrote:
>>
> Actually, it's rspec's edge that breaks it, documented here:
>
> http://github.com/dchelimsky/rspec-rails/blob/mast...
>
> Somebody should probably offer up a patch to restful_authentication.
> I'll do it unless anybody else cares to volunteer.

Actually, I'm already on it.
David C. (Guest)
on 2009-03-09 06:53
(Received via mailing list)
On Sun, Mar 8, 2009 at 10:21 PM, David C. <removed_email_address@domain.invalid>
wrote:
>>> should route users's 'destroy' action correctly
>>
>> Actually, it's rspec's edge that breaks it, documented here:
>>
>> http://github.com/dchelimsky/rspec-rails/blob/mast...
>>
>> Somebody should probably offer up a patch to restful_authentication.
>> I'll do it unless anybody else cares to volunteer.
>
> Actually, I'm already on it.

Here it is:

http://github.com/dchelimsky/restful-authenticatio...

I've sent technoweenie a pull request.

Thanks for bringing this to my attention.

Cheers,
David
Yi W. (Guest)
on 2009-03-09 06:54
(Received via mailing list)
David, thanks very much

Yi
This topic is locked and can not be replied to.