Chore: Minor bugfixes and housekeeping tasks (#896)

This commit is contained in:
Sojan Jose
2020-06-02 23:50:39 +05:30
committed by GitHub
parent 93d8a25877
commit dafabac796
21 changed files with 271 additions and 51 deletions

View File

@@ -119,6 +119,18 @@ RSpec.describe 'Conversations API', type: :request do
expect(response).to have_http_status(:success)
expect(conversation.reload.status).to eq('open')
end
it 'toggles the conversation status to specific status when parameter is passed' do
expect(conversation.status).to eq('open')
post "/api/v1/accounts/#{account.id}/conversations/#{conversation.display_id}/toggle_status",
headers: agent.create_new_auth_token,
params: { status: 'bot' },
as: :json
expect(response).to have_http_status(:success)
expect(conversation.reload.status).to eq('bot')
end
end
end