运行 rspec 测试用例时出现此错误。
swagger doc 正在正确创建。我想我缺少一些与 rspec 相关的配置更改路由。
我正在分享我的规范文件以供参考,请检查。如果您需要任何其他详细信息,请告诉我。
Failure/Error: raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"
ActionController::RoutingError:
No route matches [POST] "/api/v1/orders"
describe 'Orders API' do
path '/orders' do
post 'Get menu for new business order' do
tags 'Business Orders'
parameter name: :business_order, in: :body, schema: {
type: :object,
properties: {
latitude: { type: :string },
longitude: { type: :string }
},
required: ['latitude', 'longitude' ]
}
response '200', 'success' do
let(:business_order) { {latitude: 0.000,longitude: 0.00 } }
run_test!
end
end
end
end