DEV: Use json schema file to describe update group endpoint (#17825)
Updating another endpoint in our api docs to use json schema files for describing the request/response bodies.
This commit is contained in:
parent
f7e7f9a6a7
commit
ec54777f4c
|
@ -60,17 +60,9 @@ RSpec.describe 'groups' do
|
|||
operationId 'updateGroup'
|
||||
consumes 'application/json'
|
||||
parameter name: :id, in: :path, type: :integer
|
||||
parameter name: :group, in: :body, schema: {
|
||||
type: :object,
|
||||
properties: {
|
||||
group: {
|
||||
type: :object,
|
||||
properties: {
|
||||
name: { type: :string },
|
||||
}, required: ['name']
|
||||
}
|
||||
}, required: ['group']
|
||||
}
|
||||
|
||||
expected_request_schema = load_spec_schema('group_create_request')
|
||||
parameter name: :params, in: :body, schema: expected_request_schema
|
||||
|
||||
produces 'application/json'
|
||||
response '200', 'success response' do
|
||||
|
@ -79,7 +71,7 @@ RSpec.describe 'groups' do
|
|||
}
|
||||
|
||||
let(:id) { Fabricate(:group).id }
|
||||
let(:group) { { name: 'awesome' } }
|
||||
let(:params) { { 'group' => { 'name' => 'awesome' } } }
|
||||
|
||||
run_test!
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue