Asserting that a mixin is present

Hi

I can’t seem to find a way to do this (maybe it’s not supposed to be done :P).

I’m using ember-simple-auth for authentication, and I would like to have my route tests asserting that the AuthenticatedRouteMixin is present (instead of having to create one more acceptance test where I check that when you visit the route you’re redirected to the login route).

How can I achieve this? Should I want to achieve this?

Thanks for any help

You can use Mixin - 4.6 - Ember API Documentation to do exactly that.

let r = Em.Route.extend(AuthenticatedRouteMixin).create();
AuthenticatedRouteMixin.detect(r); // true

Hey @maxn, thanks for replying. It seems though that the detect method is private :frowning:

I really would like to avoid using private methods, any other idea/workaround?

Thanks again for taking the time to reply!