Hello list,
this should be an easy one, but I seem to be stuck.
What is the proper way to mimic a POST request for a named, non-RESTful
route?
here's the route and the rest of the setup:
map.accept_invitation '/accept_invitation/:id', :controller =>
"invitations", :action => "accept", :method => "post"
class InvitationsController < ApplicationController
def accept
end
end
describe InvitationsController do
describe "POST 'accept'" do
it "should be successful" do
post :accept, :id => 1
response.should be_success
end
end
end
When I run this spec, I get:
No route matches {:controller=>"invitations", :action=>"accept",
:id=>"1"}
Can anyone please suggest what I should be writing instead to test this
request?
Thanks in advance!
Giuseppe
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users