Fix /api/v1/conversations sometimes returning empty accounts (#25499)
This commit is contained in:
parent
036ac5b5c9
commit
4c6c790f80
2 changed files with 6 additions and 10 deletions
|
@ -16,6 +16,7 @@ RSpec.describe Api::V1::ConversationsController, type: :controller do
|
|||
|
||||
before do
|
||||
PostStatusService.new.call(other.account, text: 'Hey @alice', visibility: 'direct')
|
||||
PostStatusService.new.call(user.account, text: 'Hey, nobody here', visibility: 'direct')
|
||||
end
|
||||
|
||||
it 'returns http success' do
|
||||
|
@ -31,7 +32,8 @@ RSpec.describe Api::V1::ConversationsController, type: :controller do
|
|||
it 'returns conversations' do
|
||||
get :index
|
||||
json = body_as_json
|
||||
expect(json.size).to eq 1
|
||||
expect(json.size).to eq 2
|
||||
expect(json[0][:accounts].size).to eq 1
|
||||
end
|
||||
|
||||
context 'with since_id' do
|
||||
|
@ -39,7 +41,7 @@ RSpec.describe Api::V1::ConversationsController, type: :controller 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
|
||||
expect(json.size).to eq 2
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue