From ed51cde4018c9cebe2b2f1d8b37e847e6c8300f2 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 27 Mar 2015 15:15:03 -0800 Subject: [PATCH] Test env, missed import --- app/models/strain.js | 1 + config/environment.js | 32 +++++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/app/models/strain.js b/app/models/strain.js index 74503ee..1c05651 100644 --- a/app/models/strain.js +++ b/app/models/strain.js @@ -1,4 +1,5 @@ import DS from 'ember-data'; +import Ember from 'ember'; export default DS.Model.extend({ measurements: DS.hasMany('measurements', { async: true }), diff --git a/config/environment.js b/config/environment.js index f7ffa20..ec6ebb6 100644 --- a/config/environment.js +++ b/config/environment.js @@ -55,15 +55,37 @@ module.exports = function(environment) { } if (environment === 'test') { - // Testem prefers this... - ENV.baseURL = '/'; - ENV.locationType = 'none'; + ENV['simple-auth'] = { + authorizer: 'simple-auth-authorizer:token', + crossOriginWhitelist: ['https://bactdb-test.herokuapp.com'] + } + ENV['simple-auth-token'] = { + serverTokenEndpoint: 'https://bactdb-test.herokuapp.com/api/authenticate', + identificationField: 'username', + passwordField: 'password', + tokenPropertyName: 'token', + authorizationPrefix: 'Bearer ', + authorizationHeaderName: 'Authorization', + refreshAccessTokens: true, + serverTokenRefreshEndpoint: 'https://bactdb-test.herokuapp.com/api/authenticate', + tokenExpireName: 'exp', + refreshLeeway: 300, + timeFactor: 1 + } + ENV.apiURL = 'https://bactdb-test.herokuapp.com'; + ENV.contentSecurityPolicy = { + 'default-src': "'none'", + 'script-src': "'self'", + 'font-src': "'self'", + 'connect-src': "'self' https://bactdb-test.herokuapp.com", + 'img-src': "'self'", + 'style-src': "'self'", + 'media-src': "'self'" + } // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; } if (environment === 'production') {