Module: Tapioca::TestHelpers

Extended by:
ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::TagHelper
Defined in:
lib/tapioca/test_helpers.rb,
lib/tapioca/test_helpers/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.disable_animationsObject

Public: generates JavasCript code to disable all animations so that tests won’t timeout waiting for animations to run.

  • Turns off jQuery.fx.

  • Turns off bootstrap transition support.

  • Removes the fade class from modal boxes since that uses css animations.

  • Overrides collapsible elements to avoid waiting for the height css transition.



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tapioca/test_helpers.rb', line 18

def self.disable_animations
  javascript_tag "    $.fx.off = true;\n    $.support.transition = false;\n\n    var disableBootstrapTransitions = function() {\n      $('.modal').removeClass('fade');\n      $('.collapse').css({ 'transition': 'height 0.005s', '-webkit-transition': 'height 0.005s' });\n    };\n    $(disableBootstrapTransitions); $(document).ajaxComplete(disableBootstrapTransitions);\n  JAVASCRIPT\nend\n"