I know you have to supply { :version => nnn } with each, but either that doesn't work with post or the post method is getting confused about which argument is the version number and which is the post payload. Didn't see anything in the docs about post(), only get() with rspec.
First, here are my routes:
api :version => 1 do
resource :authenticate, :controller => "authenticate", :only => [ :show, :create, :update, :destroy ]
end
Now, the code I am having problems with. I want to simulate a post, so doing:
post :create, :version => 1, { :email => 'some@email.com', :password => 'some_password' }
..returns:
syntax error, unexpected '\n', expecting tASSOC (SyntaxError)
Similarly, doing:
post :create, { :email => 'some@email.com', :password => 'some_password' }, :version => 1
..returns:
ActionController::RoutingError: No route matches {:email=>"some@email.com", :password=>"some_password", :controller=>"authenticate", :action=>"create"}
What is the syntax for a post in rspec with RP? The standard rails/rspec syntax doesn't appear to work, or I am missing something.
Thanks for your insight, after placing the :version symbol in proper place it is working now. I have forked + updated the readme to mention the
post
syntax and the default_version flag.