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 }