Skip to content

Commit 53256d1

Browse files
committed
Merge conflicts resolved
2 parents 54eb7d6 + 377d1e8 commit 53256d1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

test/test_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@
2222
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
2323
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
2424
end
25+
26+
def wait_for_turbolinks_to_be_available
27+
sleep(1)
28+
end

test/view_helper_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ class ViewHelperTest < ActionDispatch::IntegrationTest
6262
page.execute_script('history.back();')
6363
assert page.has_content?('Hello Alice')
6464

65+
wait_for_turbolinks_to_be_available()
66+
6567
# Try Turbolinks javascript API.
6668
page.execute_script('Turbolinks.visit("/pages/2");')
6769
assert page.has_content?('Hello Alice')
6870

69-
# Sometimes Turbolinks isn't available right away. We need to wait for a brief moment
70-
# for phantomJS to finish loading javascript.
71-
sleep(1)
71+
wait_for_turbolinks_to_be_available()
7272

7373
page.execute_script('Turbolinks.visit("/pages/1");')
7474
assert page.has_content?('Hello Bob')

0 commit comments

Comments
 (0)