mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
FEATURE: use the exact name provided by auth provider
Previously we would attempt to titleize it causing names like McDonald's not to work as expected
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
require 'single_sign_on'
|
||||
|
||||
RSpec.describe Users::OmniauthCallbacksController do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
@ -98,16 +99,16 @@ RSpec.describe Users::OmniauthCallbacksController do
|
||||
uid: '123545',
|
||||
info: OmniAuth::AuthHash::InfoHash.new(
|
||||
email: email,
|
||||
name: 'Some name',
|
||||
name: 'Some Name',
|
||||
first_name: "Some",
|
||||
last_name: "name"
|
||||
last_name: "Name"
|
||||
),
|
||||
extra: {
|
||||
raw_info: OmniAuth::AuthHash.new(
|
||||
email_verified: true,
|
||||
email: email,
|
||||
family_name: 'Huh',
|
||||
given_name: "Some name",
|
||||
given_name: "Some Name",
|
||||
gender: 'male',
|
||||
name: "Some name Huh",
|
||||
)
|
||||
@ -128,7 +129,7 @@ RSpec.describe Users::OmniauthCallbacksController do
|
||||
response_body = JSON.parse(response.body)
|
||||
|
||||
expect(response_body["email"]).to eq(email)
|
||||
expect(response_body["username"]).to eq("Some_name")
|
||||
expect(response_body["username"]).to eq("Some_Name")
|
||||
expect(response_body["auth_provider"]).to eq("google_oauth2")
|
||||
expect(response_body["email_valid"]).to eq(true)
|
||||
expect(response_body["omit_username"]).to eq(false)
|
||||
|
Reference in New Issue
Block a user