Bugfix: Use server timestamp to set agent_last_seen_at (#1114)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user