File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,11 @@ def test_client_retry_after_seconds
126126 end
127127
128128 def test_client_retry_after_date
129+ time_now = Time . now
130+
129131 stub_request ( :get , "http://localhost/employer/directory" ) . to_return_json (
130132 status : 500 ,
131- headers : { "retry-after" => ( Time . now + 10 ) . httpdate } ,
133+ headers : { "retry-after" => ( time_now + 10 ) . httpdate } ,
132134 body : { }
133135 )
134136
@@ -141,11 +143,11 @@ def test_client_retry_after_date
141143 max_retries : 1
142144 )
143145
146+ Thread . current . thread_variable_set ( :time_now , time_now )
144147 assert_raises ( FinchAPI ::Errors ::InternalServerError ) do
145- Thread . current . thread_variable_set ( :time_now , Time . now )
146148 finch . hris . directory . list
147- Thread . current . thread_variable_set ( :time_now , nil )
148149 end
150+ Thread . current . thread_variable_set ( :time_now , nil )
149151
150152 assert_requested ( :any , /./ , times : 2 )
151153 assert_in_delta ( 10 , Thread . current . thread_variable_get ( :mock_sleep ) . last , 1.0 )
You can’t perform that action at this time.
0 commit comments