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:
Blake Erickson 2022-08-08 17:52:08 +01:00 committed by GitHub
parent f7e7f9a6a7
commit ec54777f4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 12 deletions

View File

@ -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