feat: Add assignee last seen to conversations (#3069)

- Adds assignee last seen attribute to conversations
This commit is contained in:
Tejaswini Chile
2021-09-23 20:59:10 +05:30
committed by GitHub
parent 4f51a46c2b
commit 54bdb2957f
7 changed files with 28 additions and 1 deletions

View File

@@ -393,6 +393,19 @@ RSpec.describe 'Conversations API', type: :request do
expect(response).to have_http_status(:success)
expect(conversation.reload.agent_last_seen_at).not_to eq nil
end
it 'updates assignee last seen' do
conversation.update!(assignee_id: agent.id)
expect(conversation.reload.assignee_last_seen_at).to eq nil
post "/api/v1/accounts/#{account.id}/conversations/#{conversation.display_id}/update_last_seen",
headers: agent.create_new_auth_token,
as: :json
expect(response).to have_http_status(:success)
expect(conversation.reload.assignee_last_seen_at).not_to eq nil
end
end
end