File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 2222if ActiveSupport ::TestCase . method_defined? ( :fixture_path= )
2323 ActiveSupport ::TestCase . fixture_path = File . expand_path ( "../fixtures" , __FILE__ )
2424end
25+
26+ def wait_for_turbolinks_to_be_available
27+ sleep ( 1 )
28+ end
Original file line number Diff line number Diff 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' )
You can’t perform that action at this time.
0 commit comments