Я запускаю спецификацию в Rails с swagger и у меня появляется эта ошибка
define_method (name) {__memoized.fetch_or_store (name) {super (& nil)}}
Это мой код в post_spec.rb
require 'swagger_helper'
describe 'Fedaby API' do
path '/posts' do
get 'Get all post' do
tags 'Posts'
consumes 'application/json', 'application/xml'
produces 'application/json'
response '200', 'Array with all post' do
run_test!
end
end
end
path '/posts' do
post 'Create post' do
tags 'Posts'
consumes 'application/json', 'application/xml'
produces 'application/json'
parameter name: :post, in: :body, schema: {
type: :object,
properties: {
title: { type: :string },
body: { type: :string },
vote: { type: :integer },
image: { type: :string },
user_id: { type: :integer }
}
}
response '201', 'Post created' do
let(:post) { { title: 'test', body: 'test_body', vote: 0, image: 'test_image', user_id: 1 } }
run_test!
end
response '422', 'invalid request' do
let(:post) {{ title: 'test' }}
run_test!
end
end
end
end
Сбои
Failures:
1) Fedaby API /posts post Post created returns a 201 response
Failure/Error: define_method(name) { __memoized.fetch_or_store(name) { super(&nil) } }
ArgumentError:
wrong number of arguments (given 2, expected 0)
Я использую gem rspec-rails и rswag-specs