2024-11-19 07:57:42 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2024-11-19 08:56:51 +01:00
|
|
|
require 'swagger_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'passwords', type: :request do
|
|
|
|
path '/passwords' do
|
|
|
|
post('send a password (re)set email') do
|
|
|
|
tags 'Passwords'
|
|
|
|
consumes 'application/json'
|
|
|
|
produces 'application/json'
|
|
|
|
parameter name: :body, in: :body, schema: {
|
|
|
|
type: :object,
|
|
|
|
required: [:email_address],
|
|
|
|
properties: {
|
|
|
|
email_address: { type: :string, format: :email }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
response_empty_201
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
path '/passwords/{token}' do
|
|
|
|
parameter name: 'token', in: :path, type: :string, description: 'token'
|
|
|
|
put('update password') do
|
|
|
|
tags 'Passwords'
|
|
|
|
consumes 'application/json'
|
|
|
|
produces 'application/json'
|
|
|
|
parameter name: :body, in: :body, schema: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[password password_confirmation],
|
|
|
|
properties: {
|
|
|
|
password: { type: :string },
|
|
|
|
password_confirmation: { type: :string }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
response_empty_200
|
|
|
|
response_422
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|