Timecop post creation for cucumber

This commit is contained in:
Jonne Haß 2012-04-07 00:09:16 +02:00
parent c1694eb06e
commit dba3dbbfeb

View file

@ -1,8 +1,12 @@
module PublishingCukeHelpers module PublishingCukeHelpers
def make_post(text) def make_post(text)
fill_in 'status_message_fake_text', :with => text @@last_post_time ||= Time.now
click_button :submit Timecop.travel @@last_post_time += 1.minute do
wait_for_ajax_to_finish fill_in 'status_message_fake_text', :with => text
click_button :submit
wait_for_ajax_to_finish
end
Timecop.return
end end
def click_and_post(text) def click_and_post(text)