Browse Source

feat: fix validations_spec.rb

pull/1378/head
natdeanlewissoftwire 3 years ago
parent
commit
b8acd8b9af
  1. 12
      spec/features/form/validations_spec.rb

12
spec/features/form/validations_spec.rb

@ -2,6 +2,16 @@ require "rails_helper"
require_relative "helpers" require_relative "helpers"
RSpec.describe "validations" do RSpec.describe "validations" do
around do |example|
Timecop.freeze(Time.zone.local(2022, 1, 1)) do
Singleton.__init__(FormHandler)
example.run
end
Timecop.return
Singleton.__init__(FormHandler)
end
let(:fake_2021_2022_form) { Form.new("spec/fixtures/forms/2021_2022.json") } let(:fake_2021_2022_form) { Form.new("spec/fixtures/forms/2021_2022.json") }
let(:user) { FactoryBot.create(:user) } let(:user) { FactoryBot.create(:user) }
let(:lettings_log) do let(:lettings_log) do
@ -26,6 +36,8 @@ RSpec.describe "validations" do
status: 1, status: 1,
declaration: nil, declaration: nil,
startdate: Time.zone.local(2021, 5, 1), startdate: Time.zone.local(2021, 5, 1),
voiddate: Time.zone.local(2021, 5, 1),
mrcdate: Time.zone.local(2021, 5, 1),
) )
end end
let(:id) { lettings_log.id } let(:id) { lettings_log.id }

Loading…
Cancel
Save