Browse Source

feat: move timecop around all tests not just first describe (#2023)

pull/2024/head
natdeanlewissoftwire 1 year ago committed by GitHub
parent
commit
4d2d4767c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      spec/lib/tasks/send_missing_addresses_csv_spec.rb

14
spec/lib/tasks/send_missing_addresses_csv_spec.rb

@ -2,16 +2,16 @@ require "rails_helper"
require "rake"
RSpec.describe "correct_addresses" do
around do |example|
Timecop.freeze(Time.zone.local(2023, 10, 10)) do
Singleton.__init__(FormHandler)
example.run
end
end
describe ":send_missing_addresses_lettings_csv", type: :task do
subject(:task) { Rake::Task["correct_addresses:send_missing_addresses_lettings_csv"] }
around do |example|
Timecop.freeze(Time.zone.local(2023, 10, 10)) do
Singleton.__init__(FormHandler)
example.run
end
end
before do
organisation.users.destroy_all
Rake.application.rake_require("tasks/send_missing_addresses_csv")

Loading…
Cancel
Save