On 4 Jan., 18:20, Colin Law <[email protected]> wrote:
> On 4 January 2012 17:13, Nick Sutterer <[email protected]> wrote:
>
>
>
> > Hi, just wondering why it makes sense to verify routing in an
> > AC::TestCase test.
>
> > class XX < ActionController::TestCase
> >    it "returns an empty cart" do
> >      post :create
> >      ...
> >    end
> >  end
>
> > If I have no routing set up:
>
> > Failure/Error: post :create, :format => "json"
> >     No route matches {:controller=>"carts", :action=>"create"}
>
> > Since I only wanna test my controller action why would I need routing?
> > Any hints on this, or is this just a relict that can be removed?
>
> What would be the purpose of a controller action without a route to
> it?  There would be no way to invoke the action either from a test or
> from a browser.
>
Found out the existing route is required to compute the current
simulated request URL, so maybe you're right. Thx
> Colin

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to