make Timecop travel persistent for the whole run

So now we're getting dirty, this wouldn't be necessary with my solution...
This commit is contained in:
Jonne Haß 2012-04-10 11:54:06 +02:00
parent 11d9b50f3a
commit 5d9bdd80ab
2 changed files with 4 additions and 12 deletions

View file

@ -5,11 +5,8 @@ Feature: The activity stream
When I sign in as "bob@bob.bob"
And I post "A- I like turtles"
And I wait for 1 second
And I post "B- barack obama is your new bicycle"
And I wait for 1 second
And I post "C- barack obama is a square"
And I wait for 1 second
When I go to the activity stream page
Then "C- barack obama is a square" should be post 1
@ -17,11 +14,8 @@ Feature: The activity stream
And "A- I like turtles" should be post 3
When I like the post "A- I like turtles"
And I wait for 1 second
And I comment "Sassy sawfish" on "C- barack obama is a square"
And I wait for 1 second
And I like the post "B- barack obama is your new bicycle"
And I wait for 1 second
When I go to the activity stream page
Then "B- barack obama is your new bicycle" should be post 1

View file

@ -1,12 +1,10 @@
module PublishingCukeHelpers
def make_post(text)
@@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
Timecop.travel @@last_post_time += 1.minute
fill_in 'status_message_fake_text', :with => text
click_button :submit
wait_for_ajax_to_finish
end
def click_and_post(text)