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 ]
endNow, the code I am having problems with. I want to simulate a post, so doing:
post :create, :version => 1, { :email => '[email protected]', :password => 'some_password' }..returns:
syntax error, unexpected '\n', expecting tASSOC (SyntaxError)Similarly, doing:
post :create, { :email => '[email protected]', :password => 'some_password' }, :version => 1..returns:
ActionController::RoutingError: No route matches {:email=>"[email protected]", :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
postsyntax and the default_version flag.