Skip to content

Commit

Permalink
fix a test and remove a test
Browse files Browse the repository at this point in the history
  • Loading branch information
jagthedrummer committed Nov 20, 2024
1 parent 7c3e725 commit ead98a3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
1 change: 1 addition & 0 deletions bullet_train/app/models/concerns/teams/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions bullet_train/test/models/team_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]", 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

0 comments on commit ead98a3

Please sign in to comment.