Add timestamp spec for markers API response (#38206)
This commit is contained in:
1 parent
2f989c780a
commit
e2bf09d57d
2 files changed
+10
-9
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user