mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FEATURE: Add timezone to core user_options (#8380)
* Add timezone to user_options table * Also migrate existing timezone values from UserCustomField, which is where the discourse-calendar plugin is storing them * Allow user to change their core timezone from Profile * Auto guess & set timezone on login & invite accept & signup * Serialize user_options.timezone for group members. this is so discourse-group-timezones can access the core user timezone, as it is being removed in discourse-calendar. * Annotate user_option with timezone * Validate timezone values
This commit is contained in:
@ -702,6 +702,22 @@ describe UsersController do
|
||||
post_user
|
||||
expect(User.find_by(username: @user.username).locale).to eq('fr')
|
||||
end
|
||||
|
||||
context "when timezone is provided as a guess on signup" do
|
||||
let(:post_user_params) do
|
||||
{ name: @user.name,
|
||||
username: @user.username,
|
||||
password: "strongpassword",
|
||||
email: @user.email,
|
||||
timezone: "Australia/Brisbane" }
|
||||
end
|
||||
|
||||
it "sets the timezone" do
|
||||
post_user
|
||||
expect(response.status).to eq(200)
|
||||
expect(User.find_by(username: @user.username).user_option.timezone).to eq("Australia/Brisbane")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when creating a non active user (unconfirmed email)' do
|
||||
|
Reference in New Issue
Block a user