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. 6
      spec/lib/tasks/send_missing_addresses_csv_spec.rb

6
spec/lib/tasks/send_missing_addresses_csv_spec.rb

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

Loading…
Cancel
Save