Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions spec/models/event_registration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,10 @@ def registration_with_scholarship
end

describe "#joinable?" do
# Freeze the clock so the join-window boundary cases (events placed exactly
# 1 minute inside the 30-minute buffer) can't flake on wall-clock drift.
before { freeze_time }

let(:event) { create(:event, cost_cents: 1099, start_date: 1.hour.ago, end_date: 1.hour.from_now) }
let(:user) { create(:user, :with_person) }

Expand Down
4 changes: 4 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
RSpec.configure do |config|
# Gives travel method for time helpers
config.include ActiveSupport::Testing::TimeHelpers
# RSpec doesn't run minitest teardown, so travel_to never auto-reverts β€” freeze
# one example and the frozen clock leaks into later specs. Always reset after
# each example (no-op when time wasn't traveled).
config.after { travel_back }

# Include pagination helper globally
config.include PaginationHelpers
Expand Down