Tim Uckun
2010-Aug-03 04:33 UTC
curl works when testing JSON response but the functional and integration tests do not work.
I am trying to test an action which is supposed to give a json
response The url goes something line /blah/model.json
When I POST to that URL using curl like this
curl -H "Content-Type:application/json" -H
"Accept:appn/json" -d
"data" http://localhost:3000/blah/model.json it works just fine.
In my test functional test I have this method
def post_json (data)
post "/blah/model.json", {:data => data.to_json},
{''Content-Type''
=> ''application/json'', ''Accept'' =>
''application/json''}
end
When I run this test I get the error
ActionController::UnknownAction: No action responded to
/blah/model.json. Actions: index
The route is defined like this.
map.connect ''/blah/:model.:format'', :controller =>
''xfer'', :action =>
''index'' , :conditions => { :method => :post }
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
