Ok, so my issue is this: I have a project I'm working on
here that uses a new url spec I'm working on. without going into to much detail, if a request comes in for the following url
GET photos(name,thumbnail) it would be routed to the
PhotosController.
read method. This works properly when the call is made from an AJAX request.
My problem is that I'm trying to write functional tests to validate this functionality but nothing is working. I've looked all over the web and read
lots of blog posts, but I can't find anything covering the new way Rails does routing. I've tried:
CODE
Routes.named_routes[:read].recognize(path, env)
All I get back is null - and I can't find documentation for the recognize method anywhere.
The code in my test is shown below:
CODE
require 'test/helper'
ActionController::Routing::Routes = Caesar::Query::Set.new
ActionController::Routing::RouteSet::Mapper.send :include, Caesar::Live
class LiveQueriesTest < Test::Unit::TestCase #:nodoc:
def setup
ActionController::Routing::Routes.draw do |map|
map.queries
end
end
def test_live_queries
puts ActionController::Routing:Routes.named_routes[:read].recognize('photos(name,thumbnail)', :action => 'read', :qualifiers => 'ssid/:ssid', :method => :get)
end
end
The puts call displays nil. Any help would be greatly appreciated.