Hello,
I’m creating a REST resource with the following map
*map.resources :books, :member => { :prices => :get }
*
I would like to test the books controller
class BooksController < ApplicationController
def prices
render :text => “Test”
end
end
I have the following test
it “should render properly when getting /books/:id/prices” do
get “prices”
response.should be_success
end
This is what I get
ActionController::RoutingError in ‘BooksController requesting
/books/:id/prices
using GET should render properly when getting /books/:id/prices’
No route matches {:controller=>“books”, :action=>“prices”}
./spec/controllers/books_controller_spec.rb:5:
I’ve tried many different alternatives for get, but they always end up
with
the same error. I’m surely missing something. Any help would be
appreciated.
Thanks
Olivier D.