Hi,
I'm using Rails 3.0 and I have the following in my routes.rb files:
scope "/:location" do
resources :agents
end
So I can do this:
agents = Agent.where("location = ?", params[:location])
(There might be a better way to do this..? Mostly I want URLs like: myurl.com/london/agents
)
Anyway, my problem is with the tests (which I'm still learning), how can I make this work with the scope:
class AgentsControllerTest < ActionController::TestCase
test "should get index" do
get 'index'
assert_response :success
end
end
It just gets a route no found error.
Any help would be great, thanks.