Fix the broken oauth tests.

* render is asynchronous, so return the promise in the beforeEach functions.
* We were initializing the OAuth with the incorrect window.
fix the jscs error
Use one function to complete OAuth transactions, not two.