wedding-planner/spec/requests/affinities_spec.rb
Manuel Bustillo 9fe649f8b8
All checks were successful
Check usage of free licenses / check-licenses (pull_request) Successful in 37s
Add copyright notice / copyright_notice (pull_request) Successful in 55s
Run unit tests / unit_tests (pull_request) Successful in 1m42s
Update swagger documentation
2024-12-28 16:43:58 +01:00

53 lines
1.5 KiB
Ruby

# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'affinities', type: :request do
path '/{slug}/groups/{group_id}/affinities' do
parameter Swagger::Schema::SLUG
parameter name: 'group_id', in: :path, type: :string, format: :uuid, description: 'group_id'
get('list affinities') do
tags 'Affinities'
produces 'application/json'
response(200, 'successful') do
schema type: :object, additionalProperties: { type: :integer, minimum: 0, maximum: 2 }
xit
end
end
end
path '/{slug}/groups/{group_id}/affinities/bulk_update' do
parameter Swagger::Schema::SLUG
parameter name: 'group_id', in: :path, type: :string, format: :uuid, description: 'group_id'
put('bulk update affinities') do
tags 'Affinities'
produces 'application/json'
consumes 'application/json'
parameter name: :body, in: :body, schema: {
type: :object,
required: [:affinities],
properties: {
affinities: {
type: :array,
items: {
type: :object,
required: %i[group_id affinity],
properties: {
group_id: { type: :string, format: :uuid, description: 'ID of the associated group' },
affinity: { type: :integer, minimum: 0, maximum: 2 }
}
}
}
}
}
response_empty_200
end
end
end