mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
chore: Allow setting "users.display_name" in Platform API (#5532)
This commit is contained in:
@@ -96,15 +96,24 @@ RSpec.describe 'Platform Users API', type: :request do
|
||||
|
||||
it 'creates a new user and permissible for the user' do
|
||||
expect do
|
||||
post '/platform/api/v1/users/', params: { name: 'test', email: 'test@test.com', password: 'Password1!',
|
||||
post '/platform/api/v1/users/', params: { name: 'test', display_name: 'displaytest',
|
||||
email: 'test@test.com', password: 'Password1!',
|
||||
custom_attributes: { test: 'test_create' } },
|
||||
headers: { api_access_token: platform_app.access_token.token }, as: :json
|
||||
end.not_to enqueue_mail
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
expect(data['email']).to eq('test@test.com')
|
||||
expect(data['custom_attributes']['test']).to eq('test_create')
|
||||
expect(data).to match(
|
||||
hash_including(
|
||||
'name' => 'test',
|
||||
'display_name' => 'displaytest',
|
||||
'email' => 'test@test.com',
|
||||
'custom_attributes' => {
|
||||
'test' => 'test_create'
|
||||
}
|
||||
)
|
||||
)
|
||||
expect(platform_app.platform_app_permissibles.first.permissible_id).to eq data['id']
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user