Last active
October 6, 2018 07:55
-
-
Save uldza/299e6670989b827bb385 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Add sinon.js gem to your `group :development, :test` | |
| gem 'sinon-rails' | |
| # Add code to stub javascript time in your application.haml (.erb) layout file, at the same time you are using Timecop.travel | |
| - if defined?(Timecop) && Timecop.top_stack_item | |
| = javascript_include_tag "sinon" | |
| - unix_millis = (Time.now.to_f * 1000.0).to_i | |
| :javascript | |
| sinon.useFakeTimers(#{unix_millis}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment