mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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:
@@ -1048,6 +1048,16 @@ RSpec.describe SessionController do
|
||||
expect(user.user_auth_tokens.count).to eq(1)
|
||||
expect(UserAuthToken.hash_token(cookies[:_t])).to eq(user.user_auth_tokens.first.auth_token)
|
||||
end
|
||||
|
||||
context "when timezone param is provided" do
|
||||
it "sets the user_option timezone for the user" do
|
||||
post "/session.json", params: {
|
||||
login: user.username, password: 'myawesomepassword', timezone: "Australia/Melbourne"
|
||||
}
|
||||
expect(response.status).to eq(200)
|
||||
expect(user.reload.user_option.timezone).to eq("Australia/Melbourne")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user has 2-factor logins' do
|
||||
|
||||
Reference in New Issue
Block a user