Browse Source

feat: fix unfrozen time-dependent test

pull/3390/head
Nat Dean-Lewis 2 weeks ago
parent
commit
eeea43499a
  1. 10
      spec/requests/sales_logs_controller_spec.rb

10
spec/requests/sales_logs_controller_spec.rb

@ -915,6 +915,16 @@ RSpec.describe SalesLogsController, type: :request do
end
context "with sales logs from a closed previous collection period" do
# These examples need logs in the archived collection year,
# so we have to enforce we are in the crossover period
around do |example|
Timecop.freeze(current_collection_start_date) do
Singleton.__init__(FormHandler)
example.run
end
Singleton.__init__(FormHandler)
end
let(:completed_sales_log) do
FactoryBot.create(
:sales_log,

Loading…
Cancel
Save