Chore: Remove duplication of user JBuilder (#911)

* Chore: Reduce duplication of user JBuilder
This commit is contained in:
Sojan Jose
2020-05-31 23:10:20 +05:30
committed by GitHub
parent d4783db6fd
commit 8c52a3a953
10 changed files with 39 additions and 53 deletions

View File

@@ -70,8 +70,10 @@ RSpec.describe 'Accounts API', type: :request do
headers: { api_access_token: super_admin.access_token.token },
as: :json
expect(User.find_by(email: email).confirmed?).to eq(true)
created_user = User.find_by(email: email)
expect(created_user.confirmed?).to eq(true)
expect(response.headers.keys).to include('access-token', 'token-type', 'client', 'expiry', 'uid')
expect(response.body).to include(created_user.access_token.token)
end
end

View File

@@ -24,6 +24,7 @@ RSpec.describe 'Profile API', type: :request do
json_response = JSON.parse(response.body)
expect(json_response['id']).to eq(agent.id)
expect(json_response['email']).to eq(agent.email)
expect(json_response['access_token']).to eq(agent.access_token.token)
end
end
end