From ead98a3de6626c0de2b1535d78dce50b1d41c864 Mon Sep 17 00:00:00 2001 From: Jeremy Green Date: Wed, 20 Nov 2024 09:14:45 -0600 Subject: [PATCH] fix a test and remove a test --- bullet_train/app/models/concerns/teams/base.rb | 1 + bullet_train/test/models/team_test.rb | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/bullet_train/app/models/concerns/teams/base.rb b/bullet_train/app/models/concerns/teams/base.rb index fa4410a6a..fc075ddf3 100644 --- a/bullet_train/app/models/concerns/teams/base.rb +++ b/bullet_train/app/models/concerns/teams/base.rb @@ -31,6 +31,7 @@ def initialize(attributes = nil) end def set_time_zone_from_user(user) + return if time_zone != "UTC" self.time_zone = user.time_zone if user.time_zone.present? save end diff --git a/bullet_train/test/models/team_test.rb b/bullet_train/test/models/team_test.rb index d8ace514c..1a8e95f80 100644 --- a/bullet_train/test/models/team_test.rb +++ b/bullet_train/test/models/team_test.rb @@ -29,18 +29,4 @@ class TeamTest < ActiveSupport::TestCase team.reload assert_equal "UTC", team.time_zone end - - test "default UTC time_zone is overwritten once the first user sets a time zone" do - team = Team.create!(name: "new test team") - user = User.create!(email: "test@test.com", password: "password", password_confirmation: "password", time_zone: nil) - Membership.create!(team: team, user: user) - team.reload - assert_equal "UTC", team.time_zone - - user.time_zone = "Central Time (US & Canada)" - user.save - - team.reload - assert_equal "Central Time (US & Canada)", team.time_zone - end end