Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
[Standup][SF] 06/08/12: coccyx: kok-siks; plural: coccyges

Helps

  • CI request spec video gem?

suggestion: use Capybara error call back and a screen shot utility.

Interestings

  • Forgotten Feature: Rails redirect_to and flash

You can set parameters in the flash scope when redirecting:

redirect_to pants_path, :notice => “Successfully put on pants!”

redirect_to pants_path, :alert => “Pants are alight! Douse them forthwith!”

redirect_to pants_path, :flash => { :error => “What pants?” }

  • should_receive(”some_string”) gives a helpful ‘stack too deep’ error

Don’t accidentally pass should_receive a method name as a string instead of a symbol. You’ll get a lovely ‘SystemStackError: stack level too deep’ error.

  • coccyx: it plugs up backbone

https://github.com/onsi/coccyx

coccyx is a tiny little addition to backbone that I cooked up that addresses finding and fixing memory leaks by solving two problems:

1) you can pass constructorName in as a parameter when defining your Backbone class to get a custom constructor name printed out (instead of “child”) in console.log and in Chrome’s heap analyzer.

2) you can call view.tearDown() to automatically unbind any callbacks attached to view.model, view.collection, and delegateEvents. You can also add a custom beforeTearDown handler to clean up any other references you might be aware of.

The best part is: if you registerSubView() as you add subviews then calls to tearDown on a root node will walk the subview hierarchy and clean the subviews up too.

Comments
Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *