jamesarosen/Timecop.js — Issue #15: Integration with Timecop gem and rails?
Author: jhilden
Created: 2012-01-16 15:34:08+00:00
State: open

Hi,

has somebody successfully integrated Timecop.js together with the original Timecop gem and rails before?

We have such code in our acceptance tests (using MiniTest and Capybara):

before do
travel_to 'October 10, 2010'
end

after do
Timecop.return
end

The problem is that our backend code is now behaving differently from our client code (in our case a jquery-ui datepicker) in this test. Maybe there is a way to inject the right javascript snippets in order to create the same behavior on the client side?

We have a `yield :head` in our application layout. Maybe this could be used to inject the JS using ActionView::Helpers::CaptureHelper.content_for ? But this is just a vague idea.

Any thoughts anybody?