Browse Source

add a test to ensure that the form handler does not add outdated forms to the forms hash with key nil

pull/1420/head
Arthur Campbell 3 years ago
parent
commit
d2dadb66b8
  1. 17
      spec/models/form_handler_spec.rb

17
spec/models/form_handler_spec.rb

@ -35,6 +35,23 @@ RSpec.describe FormHandler do
expect(all_forms.count).to be >= 1 expect(all_forms.count).to be >= 1
expect(all_forms["current_sales"]).to be_a(Form) expect(all_forms["current_sales"]).to be_a(Form)
end end
context "when in 23/24 period or later" do
let(:now) { Time.utc(2023, 6, 7) }
around do |example|
Timecop.freeze(now) do
Singleton.__init__(described_class)
example.run
end
Singleton.__init__(described_class)
end
it "does not load outdated forms" do
all_forms = form_handler.forms
expect(all_forms.keys).not_to include nil
end
end
end end
describe "Get specific form" do describe "Get specific form" do

Loading…
Cancel
Save