Merge commit '1b664cf20dbb696cf16a42efcf59ab186cb211eb' into glitch-soc/merge-upstream

This commit is contained in:
Claire committed 2025-09-05 20:03:42 +02:00
commit 6fc9febb47
65 files changed
+903 -197

No files matched your search

+25 -4
View File
@@ -110,9 +110,12 @@ RSpec.describe '/api/v1/accounts' do
let(:date_of_birth) { 13.years.ago.strftime('%d.%m.%Y') }
it 'returns http unprocessable entity' do
subject
expect { subject }
.to not_change(User, :count)
.and not_change(Account, :count)
expect(response).to have_http_status(422)
expect(response)
.to have_http_status(422)
expect(response.content_type)
.to start_with('application/json')
end
@@ -122,9 +125,27 @@ RSpec.describe '/api/v1/accounts' do
let(:date_of_birth) { 17.years.ago.strftime('%d.%m.%Y') }
it 'creates a user', :aggregate_failures do
subject
expect { subject }
.to change(User, :count).by(1)
.and change(Account, :count).by(1)
expect(response).to have_http_status(200)
expect(response)
.to have_http_status(200)
expect(response.content_type)
.to start_with('application/json')
end
end
context 'when date of birth is over age limit in ISO-8601 format' do
let(:date_of_birth) { 17.years.ago.to_date.iso8601 }
it 'creates a user', :aggregate_failures do
expect { subject }
.to change(User, :count).by(1)
.and change(Account, :count).by(1)
expect(response)
.to have_http_status(200)
expect(response.content_type)
.to start_with('application/json')
end