Skip to content

Commit

Permalink
giving another healing potion to randomly failing specs using Timecop.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiedl committed Sep 29, 2014
1 parent af086ae commit 3e70e6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@

# Clear the cache.
Rails.cache.clear

# Freeze the time. Whenever time progression is needed during a spec,
# it should be done using the `time_travel` support method: `time_travel 2.seconds`.
#
Timecop.freeze

# create the basic objects that are needed for all specs
Group.find_or_create_everyone_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
# ====================================================================================================

describe "#valid_at?(time)" do
subject { @indirect_membership.valid_at? @time_to_check }
subject { @indirect_membership.reload.valid_at? @time_to_check }
specify "preliminaries" do
@indirect_membership.earliest_direct_membership.valid_from.to_i.should == @t1.to_i
@indirect_membership.earliest_direct_membership.valid_to.to_i.should == @t2.to_i
Expand Down

0 comments on commit 3e70e6d

Please sign in to comment.