emberjs/ember.js — pull request #2914 by teddyzeenny (2013-06-30 02:24:13+00:00)
Title: Only catch promise errors after injecting helpers

The ember-testing adapter should only handle promise exceptions when inside ember-testing tests, so to ensure that, I registered the `onerror` callback inside the `injectTestHelpers` method.

There also appears to be un-handled rejections throughout the Ember code. This can cause issues while testing because an expected rejection would cause a test failure. So maybe the safest bet would be to check that the `onerror` event was triggered by an instance of `Ember.Test.Promise`. This requires minor changes to RSVP to pass along the promise that triggered the error. If you think this is a good approach, I can implement it.

cc @stefanpenner , @wycats