FIX: User fields are case insensitive in bulk CSV (#12559)

The CSV column title had to be case sensitive match with the name of
the user field which was unnecessary complex.
This commit is contained in:
Dan Ungureanu
2021-03-31 13:42:53 +03:00
committed by GitHub
parent dce48d8aa7
commit e8c576cca9
2 changed files with 5 additions and 5 deletions

View File

@@ -82,14 +82,14 @@ describe Jobs::BulkInvite do
end
it 'can create staged users and prepulate user fields' do
user_field = Fabricate(:user_field)
user_field = Fabricate(:user_field, name: "Location")
described_class.new.execute(
current_user_id: admin.id,
invites: [
{ email: 'test@discourse.org' }, # new user without user fields
{ email: user.email, user_field.name => 'value 1' }, # existing user with user fields
{ email: staged_user.email, user_field.name => 'value 2' }, # existing staged user with user fields
{ email: 'test2@discourse.org', user_field.name => 'value 3' } # new staged user with user fields
{ email: user.email, location: 'value 1' }, # existing user with user fields
{ email: staged_user.email, location: 'value 2' }, # existing staged user with user fields
{ email: 'test2@discourse.org', location: 'value 3' } # new staged user with user fields
]
)