1
0
Fork 0
forked from gitea/nas

Add API datetime/format matcher for serialization specs, reduce factories (#33325)

This commit is contained in:
Matt Jankowski 2024-12-17 08:38:57 -05:00 committed by GitHub
parent 978142ac9e
commit ce5c33c65d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 127 additions and 96 deletions

View file

@ -17,15 +17,13 @@ RSpec.describe REST::NotificationRequestSerializer do
let(:current_user) { Fabricate(:user) }
let(:notification_request) { Fabricate :notification_request }
context 'when created_at is populated' do
context 'when timestampts are populated' do
it 'parses as RFC 3339 datetime' do
expect { DateTime.rfc3339(subject['created_at']) }.to_not raise_error
end
end
context 'when updated_at is populated' do
it 'parses as RFC 3339 datetime' do
expect { DateTime.rfc3339(subject['updated_at']) }.to_not raise_error
expect(subject)
.to include(
'created_at' => match_api_datetime_format,
'updated_at' => match_api_datetime_format
)
end
end
end