wedding-planner/spec/requests/affinities_spec.rb

51 lines
1.4 KiB
Ruby
Raw Normal View History

# 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 discomfort],
properties: {
group_id: { type: :string, format: :uuid, description: 'ID of the associated group' },
discomfort: { type: :integer, minimum: 0, maximum: 2 }
}
}
}
}
}
response_empty_200
end
end
end