Skip to content

Instantly share code, notes, and snippets.

@tommeier
Created March 10, 2013 21:54
Show Gist options
  • Save tommeier/5130647 to your computer and use it in GitHub Desktop.
Save tommeier/5130647 to your computer and use it in GitHub Desktop.
Speed up specs by disabling both jQuery effects and CSS transformations
<% if Rails.env.test? %>
<%= content_for :head do %>
<style type="text/css">
.notransition * {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}
</style>
<% end %>
<script type="text/javascript">
$.fx.off = true;
$('body').addClass('notransition');
</script>
<% end %>
@tommeier
Copy link
Author

@gusgollings
Copy link

Would it be the same if you changed line 4 to "* {" and removed line 16?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment