1

I am having an issue upgrading ember simple auth.

    TypeError: Cannot read property '__container__' of undefined
        at authenticateSession (http://app.meetabe.dev:4200/assets/tests-a3c931e27860232e47d8de67d537cf75.js:298:24)
        at Object.<anonymous> (http://app.meetabe.dev:4200/assets/tests-a3c931e27860232e47d8de67d537cf75.js:90:61)

I have properly imported the new helper methods using:

import { authenticateSession } from '../helpers/ember-simple-auth';

Any thoughts on what I need to do to get it working?

Here is my test, trying to visit an authenticated route.

import { test } from 'qunit';
import moduleForAcceptance from '../helpers/module-for-acceptance';
import { authenticateSession } from '../helpers/ember-simple-auth';

moduleForAcceptance('Acceptance | overview');

test('visiting /overview', function(assert) {
  authenticateSession();
  visit('/overview');

  andThen(function() {
    assert.equal(currentURL(), '/overview');
  });
});
ancoanco
  • 220
  • 6
  • 17
  • 2
    From what version to what version to you jump? What ember version do you use? Generally the access to the private `__container__` was previously done by many applications but was removed in favor of public APIs like the DI APIs on the application and `Ember.getOwner`. – Lux Jul 18 '16 at 18:00

1 Answers1

1

Pass the App to the authenticateSession method

import startApp from '../helpers/start-app';
let App;
moduleForAcceptance('Acceptance | home', {
  beforeEach() {
    App = startApp();
  },
  afterEach() {
    Ember.run(App, App.destroy);
  }
});

test('visiting /overview', function(assert) {
  authenticateSession(App);
  ...
});