# Acceptance testing - wait for route transition

**URL:** <https://discuss.emberjs.com/t/acceptance-testing-wait-for-route-transition/8414>\
**Category:** Uncategorized\
**Created:** [July 20, 2015, 11:20am UTC](https://discuss.emberjs.com/t/acceptance-testing-wait-for-route-transition/8414 "2015-07-20T11:20:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_Douglas](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/wayne_douglas/32/9568_2.png) [@Wayne\_Douglas](https://discuss.emberjs.com/u/Wayne_Douglas)\
**Post date:** [July 20, 2015, 11:20am UTC](https://discuss.emberjs.com/t/acceptance-testing-wait-for-route-transition/8414/1 "2015-07-20T11:20:39Z")

</div>

I have the following in my acceptance test:

```
  assert.expect(1); 

  visit('/signup');
  fillIn('#login-account-name', '123@342343.com');
  fillIn('#login-username', '123-o');
  fillIn('#login-account-password', 'super-hectic-password0921');
  click('#login-register');

  andThen(function() {
    assert.equal(currentURL(), '/');
  }); 

```

Now - it all seems to be going ok - I can see that the signup posts to my mock api and the session gets authenticated in ember-simple-auth - however the transition to ‘/’ never happens.

In my controller I have:

```
// i know LoginControllerMixin is being deprecated - i am planning that upgrade work for later
import LoginControllerMixin from 'simple-auth/mixins/login-controller-mixin';
export default Ember.Controller.extend(LoginControllerMixin, {
actions: {
    authenticate: function() {
        //do some basic validation on the inputs:
        this._super()
	    .then(function() {
                _this.transitionToRoute('index');
            });
    }   
}
});

```

Now, my question is - is the test not waiting for a promise to return because my

> authenticate

action doesn’t return anything?

Or am I missing something else? Should/can actions return promises?

---

<div class="post-metadata">

**Author:** ![Wayne\_Douglas](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/wayne_douglas/32/9568_2.png) [@Wayne\_Douglas](https://discuss.emberjs.com/u/Wayne_Douglas)\
**Post date:** [July 21, 2015, 7:01am UTC](https://discuss.emberjs.com/t/acceptance-testing-wait-for-route-transition/8414/2 "2015-07-21T07:01:45Z")

</div>

And now I have a stack of tests failing because I don’t know how to handle this!

It seems that calling click on a button / link that causes a transition to another route doesn’t work. Is this right?

---

<div class="post-metadata">

**Author:** ![toranb](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/toranb/32/16579_2.png) [@toranb](https://discuss.emberjs.com/u/toranb)\
**Post date:** [July 29, 2015, 4:14pm UTC](https://discuss.emberjs.com/t/acceptance-testing-wait-for-route-transition/8414/3 "2015-07-29T16:14:06Z")

</div>

My guess is it’s simple-auth related. If you console log inside the action do you see it’s hitting your code? also -is the super call required? Also -if you drop down into the simple-auth source can you console log from it’s authenticate method (the one you call w/ super?) to see if you are hitting that ?
