wedding-planner/spec/requests/groups_spec.rb
Manuel Bustillo b8e6df732c
Some checks failed
Check usage of free licenses / check-licenses (pull_request) Successful in 41s
Add copyright notice / copyright_notice (pull_request) Failing after 1m30s
Run unit tests / unit_tests (pull_request) Successful in 4m41s
Generate user model, document some endpoints (missing email verification)
2024-11-30 14:24:02 +01:00

35 lines
1.3 KiB
Ruby

# Copyright (C) 2024 Manuel Bustillo
require 'swagger_helper'
RSpec.describe 'groups', type: :request do
path '/groups' do
get('list groups') do
tags 'Groups'
produces 'application/json'
response(200, 'successful') do
schema type: :array,
items: {
type: :object,
required: %i[id name icon parent_id color total considered invited confirmed declined tentative],
properties: {
id: { type: :string, format: :uuid, required: true },
name: { type: :string },
icon: { type: :string, example: 'pi pi-crown', description: 'The CSS classes used by the icon' },
parent_id: { type: :string, format: :uuid },
color: { type: :string, pattern: '^#(?:[0-9a-fA-F]{3}){1,2}$' },
total: { type: :integer, minimum: 0, description: 'Total number of guests in any status' },
considered: { type: :integer, minimum: 0 },
invited: { type: :integer, minimum: 0 },
confirmed: { type: :integer, minimum: 0 },
declined: { type: :integer, minimum: 0 },
tentative: { type: :integer, minimum: 0 }
}
}
xit
end
regular_api_responses
end
end
end