On Tue, Mar 25, 2008 at 7:39 PM, Perryn Fowler <pezlists@gmail.com>
wrote:>
> So I''m trying to write a completely restful application and I am
> trying to write controller tests ( well actually controller specs, but
> the problem is the same )
>
> I wanted to write something like
>
> post ''games'', {:game=>{:name
=>''test''}}
>
> which I expected to execute the create action on my controller (being
> restful and everything )
>
> Instead I got:
>
> No route matches {:controller=>"games",
:action=>"games",
> :game=>{:name=>"test"}}
>
> So instead, I had to use
>
> post ''create'', {:game=>{:name
=>''test''}}
>
> This works, but:
> 1) It requires me to have the old default restless route in my
> routes.rb, and I wanted to remove that to force restful access
> 2) Its just kinda odd. The ''post'' seems superflous in
the restful
> world, and If I''m just going to specify the action method to
call, why
> go through routing at all?
>
> Comments anyone? Am I off-base or is this a bit ugly?
>
> cheers
> Perryn
The tests run at a lower level than the restful layer (which is really
just a set of routes mapping urls to controller actions). It
shouldn''t require the default route though. I rarely non-restful
routes in my apps other than a few exceptions.
This kind of question belongs in the rubyonrails-talk list, however.
--
Rick Olson
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---