Add timestamp spec for markers API response (#38206)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2026-03-16 08:48:10 +00:00
1 parent 2f989c780a
commit e2bf09d57d
2 files changed
+10 -9

No files matched your search

+9 -2
View File
@@ -7,8 +7,10 @@ RSpec.describe 'API Markers' do
describe 'GET /api/v1/markers' do
before do
Fabricate(:marker, timeline: 'home', last_read_id: 123, user: user)
Fabricate(:marker, timeline: 'notifications', last_read_id: 456, user: user)
travel_to DateTime.parse('2026-03-15T12:34:56.789Z'), with_usec: true do
Fabricate(:marker, timeline: 'home', last_read_id: 123, user: user)
Fabricate(:marker, timeline: 'notifications', last_read_id: 456, user: user)
end
get '/api/v1/markers', headers: headers, params: { timeline: %w(home notifications) }
end
@@ -23,6 +25,11 @@ RSpec.describe 'API Markers' do
notifications: include(last_read_id: '456')
)
end
it 'uses a specific style of IS08601 timestamps' do
expect(response.parsed_body)
.to include(home: include(updated_at: eq('2026-03-15T12:34:56.789Z')))
end
end
describe 'POST /api/v1/markers' do