Skip to content

Instantly share code, notes, and snippets.

@taylorbrooks
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taylorbrooks/a7af181d907fe423bac2 to your computer and use it in GitHub Desktop.
Save taylorbrooks/a7af181d907fe423bac2 to your computer and use it in GitHub Desktop.
(0..6).each do |i|
day = Date.today.next_week + i
it "should have emails with send_at on weekdays when started on #{day.strftime('%A')}" do
Timecop.freeze(day) do
p Date.today
end
end
end
------
Email::does things
"2015-03-29"
test_0001_should have emails with send_at on weekdays when started on Monday PASS (0.42s)
"2015-03-29"
test_0007_should have emails with send_at on weekdays when started on Sunday PASS (0.09s)
"2015-03-29"
test_0006_should have emails with send_at on weekdays when started on Saturday PASS (0.16s)
"2015-03-29"
test_0004_should have emails with send_at on weekdays when started on Thursday PASS (0.08s)
"2015-03-29"
test_0003_should have emails with send_at on weekdays when started on Wednesday PASS (0.09s)
"2015-03-29"
test_0005_should have emails with send_at on weekdays when started on Friday PASS (0.08s)
"2015-03-29"
test_0002_should have emails with send_at on weekdays when started on Tuesday PASS (0.08s)
@taylorbrooks
Copy link
Author

I guess Date.today isn't moved forward and frozen inside the test block?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment