Fix ArgumentError when loading newer Private Mentions (#25399)

This commit is contained in:
Claire
2023-06-14 08:54:52 +02:00
parent 3e1724e972
commit 036ac5b5c9
3 changed files with 28 additions and 11 deletions

View File

@@ -33,5 +33,23 @@ RSpec.describe Api::V1::ConversationsController, type: :controller do
json = body_as_json
expect(json.size).to eq 1
end
context 'with since_id' do
context 'when requesting old posts' do
it 'returns conversations' do
get :index, params: { since_id: Mastodon::Snowflake.id_at(1.hour.ago, with_random: false) }
json = body_as_json
expect(json.size).to eq 1
end
end
context 'when requesting posts in the future' do
it 'returns no conversation' do
get :index, params: { since_id: Mastodon::Snowflake.id_at(1.hour.from_now, with_random: false) }
json = body_as_json
expect(json.size).to eq 0
end
end
end
end
end