我想使用api/v1/posts
rspec
测试我的创建操作
api是使用grape
所以我试过了
post 'api/v1/posts', params: { post: { name: 'name', body: 'body', published_at: Date.today } }
但我有
ArgumentError: wrong number of arguments (given 2, expected 0)
完整错误跟踪
params = { name: 'name', body: 'body', published_at: Date.today }
=> {:name=>"name", :body=>"body", :published_at=>Wed, 31 May 2017}
[91] pry(#<RSpec::ExampleGroups::APIV1Posts::Anonymous::HTTPRequestToPostAPI>)> post 'api/v1/posts', params: params
ArgumentError: wrong number of arguments (given 2, expected 0)
from /Users/stas/.rvm/gems/ruby-2.4.1/gems/rspec-core-3.6.0/lib/rspec/core/memoized_helpers.rb:298:in `block in let'
如何解决?