feat: include attachment ID in the JSON response for attachments (#201)
* feat: include attachment ID in the JSON response for attachments * test: verify attachment ID in conversation response payload
This commit is contained in:
parent
4ca0ef22c0
commit
5c99805fe2
@ -3,6 +3,7 @@ json.meta do
|
||||
end
|
||||
|
||||
json.payload @attachments do |attachment|
|
||||
json.id attachment.push_event_data[:id]
|
||||
json.message_id attachment.push_event_data[:message_id]
|
||||
json.thumb_url attachment.push_event_data[:thumb_url]
|
||||
json.data_url attachment.push_event_data[:data_url]
|
||||
|
||||
@ -953,6 +953,7 @@ RSpec.describe 'Conversations API', type: :request do
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
response_body = response.parsed_body
|
||||
expect(response_body['payload'].first['id']).to eq(conversation.messages.last.attachments.first.id)
|
||||
expect(response_body['payload'].first['file_type']).to eq('image')
|
||||
expect(response_body['payload'].first['sender']['id']).to eq(conversation.messages.last.sender.id)
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user