Chore: Render avatar url in validate token method (#448)

This commit is contained in:
Sojan Jose
2020-01-27 00:59:51 +05:45
committed by Pranav Raj S
parent 6325acd183
commit 199642d3bd
7 changed files with 59 additions and 5 deletions

View File

@@ -0,0 +1,26 @@
require 'rails_helper'
RSpec.describe 'Token Validation API', type: :request do
describe 'GET /validate_token' do
let(:account) { create(:account) }
context 'when it is an invalid token' do
it 'returns unauthorized' do
get '/auth/validate_token'
expect(response).to have_http_status(:unauthorized)
end
end
context 'when it is a valid token' do
let(:agent) { create(:user, account: account, role: :agent) }
it 'returns all the labels for the conversation' do
get '/auth/validate_token',
headers: agent.create_new_auth_token
expect(response).to have_http_status(:success)
expect(response.body).to include('payload')
end
end
end
end