diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 45b7988a05468d731eeebd2c3d8cb1ce0310c0b6..2c2e17eddb047dae954257aef24be1952a220d01 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -265,6 +265,14 @@ describe API::Users, api: true do expect(response).to have_http_status(409) expect(json_response['message']).to eq('Username has already been taken') end + + it 'creates user with new identity' do + post api("/users", admin), attributes_for(:user, provider: 'github', extern_uid: '67890') + + expect(response).to have_http_status(201) + expect(json_response['identities'].first['extern_uid']).to eq('67890') + expect(json_response['identities'].first['provider']).to eq('github') + end end end