Bugfix: Use server timestamp to set agent_last_seen_at (#1114)

This commit is contained in:
Pranav Raj S
2020-08-03 13:40:20 +05:30
committed by GitHub
parent 941272cccd
commit 3b23aa7913
12 changed files with 62 additions and 26 deletions

View File

@@ -177,15 +177,12 @@ RSpec.describe 'Conversations API', type: :request do
let(:agent) { create(:user, account: account, role: :agent) }
it 'updates last seen' do
params = { agent_last_seen_at: '-1' }
post "/api/v1/accounts/#{account.id}/conversations/#{conversation.display_id}/update_last_seen",
headers: agent.create_new_auth_token,
params: params,
as: :json
expect(response).to have_http_status(:success)
expect(conversation.reload.agent_last_seen_at).to eq(DateTime.strptime(params[:agent_last_seen_at].to_s, '%s'))
expect(conversation.reload.agent_last_seen_at).not_to eq nil
end
end
end