Last active
August 29, 2015 14:17
-
-
Save taylorbrooks/a7af181d907fe423bac2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess
Date.today
isn't moved forward and frozen inside the test block?