运行RSpec时,在控制器的作用下,(使用byebug或pry)请求参数中不存在特定值(例如,电子邮件或密码),因此测试结果失败有关更多详细信息,请参见下面的代码
path '/api/v1/admin/authentications/sign_in' do
post('admin sign_in') do
produces 'application/json'
parameter name: :params, in: :body, schema: {
type: :object,
properties: {
email: { type: :string },
password: { type: :string }
},
required: %w[email password]
}
let(:admin) { create(:admin) }
response('200', 'sign in successfully') do
let(:params) { { email: admin.email, password: '***' } }
run_test!
end
end
end
为您的请求添加消费类型:
我对于最新版本的gem rswag
也有相同的问题。您可以将gem的版本更改为“ 1.6”进行修复]