Skip to content

Commit

Permalink
add manual tracking of ember login state for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielgrant committed Oct 29, 2015
1 parent 731f765 commit 257776d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,31 @@ export default Ember.Route.extend({
let provider="password";
let email = controller.get("email");
let password = controller.get("password");
if (Ember.testing){
var waiter = (() => false);
Ember.Test.registerWaiter(waiter);
}
this.get("session").open("firebase", { provider, email, password }).then(() => {
if (Ember.testing){
Ember.Test.unregisterWaiter(waiter);
}
this.transitionTo("projects");
}, (error) => {
if (Ember.testing){
Ember.Test.unregisterWaiter(waiter);
}
controller.set("error", error);
});
},
signOut() {
if (Ember.testing){
var waiter = (() => false);
Ember.Test.registerWaiter(waiter);
}
this.get("session").close().then(() => {
if (Ember.testing){
Ember.Test.unregisterWaiter(waiter);
}
this.transitionTo("signin");
});
}
Expand Down

0 comments on commit 257776d

Please sign in to comment.