Assigning stub rather than doing it through sandbox.stub(obj, "method") means sandbox.restore() does not clean up the reference, polluting later tests
Moved helper method from "this" to closure scope as Jasmine has a different "this" context.
Assigning stub rather than doing it through sandbox.stub(obj, "method") means sandbox.restore() does not clean up the reference, polluting later tests
Mock object does not need constructor function; can just create inline for greater clarity
Moved helper method from "this" to closure scope as Jasmine has a different "this" context.
Moved helper method from "this" to closure scope as Jasmine has a different "this" context.
Stub in a way that isolates tests from each other.
Corrected syntax error
Do not stub/spy on methods that have already been stubbed/spied upon
Do not stub/spy on methods that have already been stubbed/spied upon
Moved helper method from "this" to closure scope as Jasmine has a different "this" context.