From dba3dbbfeb758e682204547ceac9fbd7cba2c166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Sat, 7 Apr 2012 00:09:16 +0200 Subject: [PATCH] Timecop post creation for cucumber --- features/support/publishing_cuke_helpers.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/features/support/publishing_cuke_helpers.rb b/features/support/publishing_cuke_helpers.rb index d51b1159d..650070533 100644 --- a/features/support/publishing_cuke_helpers.rb +++ b/features/support/publishing_cuke_helpers.rb @@ -1,8 +1,12 @@ module PublishingCukeHelpers def make_post(text) - fill_in 'status_message_fake_text', :with => text - click_button :submit - wait_for_ajax_to_finish + @@last_post_time ||= Time.now + Timecop.travel @@last_post_time += 1.minute do + fill_in 'status_message_fake_text', :with => text + click_button :submit + wait_for_ajax_to_finish + end + Timecop.return end def click_and_post(text)