Permalink
Browse files

Fix timing error when spec runs over second transition

Since expires_in is calculated from the current time the comparison
should be less than or equals since the time may cross into a
different second than the one when expires_at is set.
  • Loading branch information...
1 parent 71120c5 commit 567e702431f13dc92e479bcbcabff13b27c92755 @pixeltrix committed Jul 30, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 spec/oauth2/provider/authorization_spec.rb
@@ -213,8 +213,8 @@
it "sets the expiry time if a duration is given" do
authorization.grant_access!(:duration => 1.hour)
@model.reload
- @model.expires_in.should == 3600
- authorization.expires_in.should == 3600
+ @model.expires_in.should <= 3600
+ authorization.expires_in.should <= 3600
end
it "augments the scope" do

0 comments on commit 567e702

Please sign in to comment.