Skip to content

Commit

Permalink
Time travel test
Browse files Browse the repository at this point in the history
  • Loading branch information
allthesignals committed Oct 1, 2024
1 parent b48661b commit 96a5f56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/spec/mailers/weekly_report_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
require 'csv'

RSpec.describe WeeklyReportMailer, type: :mailer do
include ActiveSupport::Testing::TimeHelpers

let(:now) { DateTime.new(2024, 9, 9, 9, 0, 0, "-04:00") }
let(:site_id) { "nyc" }
let(:invitation_sent_at) { now - 5.days }
Expand Down Expand Up @@ -37,6 +39,10 @@
CSV.parse(mail.attachments.first.body.encoded, headers: :first_row).map(&:to_h)
end

before do
travel_to(now)
end

it "renders the subject" do
expect(mail.subject).to eq("CBV Pilot - Weekly Report Email")
end
Expand Down

0 comments on commit 96a5f56

Please sign in to comment.