mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: wasn't allowed to set a user's title anymore
This commit is contained in:
parent
28c54b42c5
commit
af01e62b14
2 changed files with 6 additions and 2 deletions
|
@ -854,6 +854,7 @@ class UsersController < ApplicationController
|
||||||
:email,
|
:email,
|
||||||
:password,
|
:password,
|
||||||
:username,
|
:username,
|
||||||
|
:title,
|
||||||
:date_of_birth,
|
:date_of_birth,
|
||||||
:muted_usernames,
|
:muted_usernames,
|
||||||
:theme_key,
|
:theme_key,
|
||||||
|
|
|
@ -1401,11 +1401,16 @@ describe UsersController do
|
||||||
put :update, params: {
|
put :update, params: {
|
||||||
username: user.username,
|
username: user.username,
|
||||||
name: 'Jim Tom',
|
name: 'Jim Tom',
|
||||||
|
title: "foobar",
|
||||||
user_fields: { user_field.id.to_s => 'happy' }
|
user_fields: { user_field.id.to_s => 'happy' }
|
||||||
}, format: :json
|
}, format: :json
|
||||||
|
|
||||||
expect(response).to be_success
|
expect(response).to be_success
|
||||||
|
|
||||||
|
user.reload
|
||||||
|
|
||||||
expect(user.user_fields[user_field.id.to_s]).to eq('happy')
|
expect(user.user_fields[user_field.id.to_s]).to eq('happy')
|
||||||
|
expect(user.title).to eq("foobar")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1416,7 +1421,6 @@ describe UsersController do
|
||||||
let!(:user) { log_in(:user) }
|
let!(:user) { log_in(:user) }
|
||||||
|
|
||||||
it 'allows the update' do
|
it 'allows the update' do
|
||||||
|
|
||||||
user2 = Fabricate(:user)
|
user2 = Fabricate(:user)
|
||||||
user3 = Fabricate(:user)
|
user3 = Fabricate(:user)
|
||||||
|
|
||||||
|
@ -1449,7 +1453,6 @@ describe UsersController do
|
||||||
expect(user.muted_users.pluck(:username).sort).to be_empty
|
expect(user.muted_users.pluck(:username).sort).to be_empty
|
||||||
expect(user.user_option.theme_key).to eq(theme.key)
|
expect(user.user_option.theme_key).to eq(theme.key)
|
||||||
expect(user.user_option.email_direct).to eq(false)
|
expect(user.user_option.email_direct).to eq(false)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'a locale is chosen that differs from I18n.locale' do
|
context 'a locale is chosen that differs from I18n.locale' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue