Reputation: 1438
I am using ember-simple-auth
with ember-cli
. I can't figure out how to pass authentication during integration tests are running.
In my startApp I lookup for session from container then set isAuthenticated
property to true but i guess it is not enough.
I reopen Session in initializer and add computed property user. For testing this one also should not look for store.
Session.reopen({
user: function() {
var userId = this.get('user_id');
if (!Ember.isEmpty(userId)) {
return container.lookup('store:main').find('user', userId);
}
}.property('userId')
});
And also I guess local-storage is not proper for testing so how to set store type to store:ephemeral
when tests are running.
I could not find any complete tutorial or anything about writing integration test when using ember-cli and ember-simple-auth. Thanks in advance
Upvotes: 4
Views: 452
Reputation: 876
marcoow has now released the official Ember Simple Auth Testing library
Upvotes: 1