File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 "ember-cli-qunit" : " 0.0.5" ,
5353 "ember-cli-simple-auth" : " ^0.7.2" ,
5454 "ember-cli-simple-auth-devise" : " ^0.7.2" ,
55+ "ember-cli-simple-auth-testing" : " ^0.7.2" ,
5556 "ember-export-application-global" : " ^1.0.0" ,
5657 "express" : " ^4.8.5" ,
5758 "glob" : " ^4.0.5"
Original file line number Diff line number Diff line change 11{
22 "predef" : [
3+ " authenticateSession" ,
4+ " invalidateSession" ,
35 " document" ,
46 " window" ,
57 " location" ,
Original file line number Diff line number Diff line change 1+ import Ember from 'ember' ;
2+ import startApp from '../helpers/start-app' ;
3+
4+ var application ;
5+
6+ module ( 'Acceptance: Auth' , {
7+ setup : function ( ) {
8+ application = startApp ( ) ;
9+ } ,
10+ teardown : function ( ) {
11+ Ember . run ( application , 'destroy' ) ;
12+ }
13+ } ) ;
14+
15+ test ( 'redirects to /login when I try to see content as not authenticated user' , function ( ) {
16+ expect ( 2 ) ;
17+
18+ invalidateSession ( ) ;
19+ visit ( '/' ) ;
20+
21+ andThen ( function ( ) {
22+ equal ( currentPath ( ) , 'login' ) ;
23+
24+ visit ( '/users' ) ;
25+
26+ andThen ( ( ) => {
27+ equal ( currentPath ( ) , 'login' ) ;
28+ } ) ;
29+ } ) ;
30+ } ) ;
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ module.exports = function(environment) {
4747 ENV . APP . LOG_VIEW_LOOKUPS = false ;
4848
4949 ENV . APP . rootElement = '#ember-testing' ;
50+ ENV [ 'simple-auth' ] = {
51+ store : 'simple-auth-session-store:ephemeral'
52+ }
5053 }
5154
5255 if ( environment === 'production' ) {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import Ember from 'ember';
22import Application from '../../app' ;
33import Router from '../../router' ;
44import config from '../../config/environment' ;
5+ import 'simple-auth-testing/test-helpers' ;
56
67export default function startApp ( attrs ) {
78 var App ;
You can’t perform that action at this time.
0 commit comments