1

I created a basic test app that uses the OMDb API (The Open Movie Database), and with some help from SO posters everything is working fine.

I added ember-simple-auth (version 1.0.0) to the project, and got the dev side of things going. Basically there's a simple login screen to get into the main app. It's working as expected.

However, my two basic acceptance tests are now not working. After adding the ember-simple-auth components and functionality to the app, to the acceptance test file I added:

import { currentSession, authenticateSession, invalidateSession } from 'movie-example/tests/helpers/ember-simple-auth';

and in a test itself, I added:

authenticateSession();

The test now fails, saying:

Cannot read property '__container__' of undefined

Moreover, if I comment out the import line and the authenticateSession() call, the test still fails, but because the DOM is apparently completely empty.

The whole thing is available in a repo if anyone is curious/willing: git@github.com:bdrsgg/ember-movie-example.git (branch = feature/ember-simple-auth)

I assume there's some configuration issue I'm getting wrong, or something like that. Appreciate any help anyone can offer.

EDITED TO ADD:

The issue definitely seems to center on authentication. For example, if I remove the AuthenticatedRouteMixin calls from the routes, and leave out authenticateSession() calls, the tests pass.

4

1 回答 1

1

Turned out I was just not declaring an earlier application variable correctly. Long story short, when I changed authenticateSession() to authenticateSession(this.application), things worked as expected.

于 2016-03-04T16:04:41.370 回答