├── .bowerrc ├── .editorconfig ├── .ember-cli ├── .jshintrc ├── .npmignore ├── .travis.yml ├── Brocfile.js ├── LICENSE ├── LICENSE.md ├── README.md ├── addon └── .gitkeep ├── app ├── .gitkeep ├── authenticators │ └── firebase.js └── initializers │ └── firebase-auth.js ├── bower.json ├── index.js ├── package.json ├── testem.json └── tests ├── .jshintrc ├── dummy ├── app │ ├── app.js │ ├── components │ │ └── .gitkeep │ ├── controllers │ │ ├── .gitkeep │ │ └── application.js │ ├── helpers │ │ └── .gitkeep │ ├── index.html │ ├── models │ │ └── .gitkeep │ ├── router.js │ ├── routes │ │ ├── .gitkeep │ │ └── application.js │ ├── styles │ │ └── app.css │ ├── templates │ │ ├── application.hbs │ │ └── components │ │ │ └── .gitkeep │ └── views │ │ └── .gitkeep ├── config │ └── environment.js └── public │ ├── crossdomain.xml │ └── robots.txt ├── helpers ├── resolver.js └── start-app.js ├── index.html ├── test-helper.js └── unit └── .gitkeep /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components", 3 | "analytics": false 4 | } 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.js] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [*.hbs] 21 | insert_final_newline = false 22 | indent_style = space 23 | indent_size = 2 24 | 25 | [*.css] 26 | indent_style = space 27 | indent_size = 2 28 | 29 | [*.html] 30 | indent_style = space 31 | indent_size = 2 32 | 33 | [*.{diff,md}] 34 | trim_trailing_whitespace = false 35 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "-Promise" 6 | ], 7 | "browser": true, 8 | "boss": true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | bower_components/ 2 | tests/ 3 | tmp/ 4 | 5 | .bowerrc 6 | .editorconfig 7 | .ember-cli 8 | .travis.yml 9 | .npmignore 10 | **/.gitkeep 11 | bower.json 12 | Brocfile.js 13 | testem.json 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | - "0.12" 5 | 6 | sudo: false 7 | 8 | cache: 9 | directories: 10 | - node_modules 11 | 12 | before_install: 13 | - "npm config set spin false" 14 | - "npm install -g npm@^2" 15 | 16 | install: 17 | - npm install -g bower 18 | - npm install 19 | - bower install 20 | 21 | script: 22 | - npm test 23 | -------------------------------------------------------------------------------- /Brocfile.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | /* global require, module */ 3 | 4 | var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 5 | 6 | var app = new EmberAddon(); 7 | 8 | // Use `app.import` to add additional libraries to the generated 9 | // output files. 10 | // 11 | // If you need to use different assets in different 12 | // environments, specify an object as the first parameter. That 13 | // object's keys should be the environment name and the values 14 | // should be the asset to use in that environment. 15 | // 16 | // If the library that you are including contains AMD or ES6 17 | // modules that you would like to import into your application 18 | // please specify an object with the list of modules as keys 19 | // along with the exports of each module as its value. 20 | 21 | module.exports = app.toTree(); 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 jamesdixon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #Firebase Authenticator for Ember Simple Auth 2 | This is a custom authenticator for the fantastic [Ember Simple Auth](https://github.com/simplabs/ember-simple-auth) project. 3 | 4 | ## Installation 5 | 6 | If you're using Ember CLI, installation is simple. Just issue the following two commands within your Ember project directory. 7 | 8 | ``` 9 | ember install emberfire 10 | ember install ember-simple-auth 11 | ember install ember-cli-simple-auth-firebase 12 | ``` 13 | Alternatively, you can clone the project and copy the contents of the `initializers` and `authenticators` folder into your project. 14 | 15 | **Note:** this addon is dependent on both [Emberfire](https://github.com/firebase/emberfire) and [Ember Simple Auth](https://github.com/simplabs/ember-simple-auth), so make sure it's part of your project if you're copying in the addon manually. 16 | 17 | ## Usage 18 | 19 | After [configuring Ember Simple Auth](https://github.com/simplabs/ember-simple-auth#the-session), you'll need to make sure your Firebase is configured in `config/environment.js` like so: 20 | 21 | `firebase: 'https://.firebaseio.com/'` 22 | 23 | To use it, you can do something like this in one of your controllers: 24 | 25 | ```javascript 26 | import Ember from 'ember'; 27 | 28 | export default Ember.Controller.extend({ 29 | 30 | actions: { 31 | login: function() { 32 | this.get('session').authenticate('authenticator:firebase', { 33 | 'email': this.get('email'), 34 | 'password': this.get('password') 35 | }).then(function() { 36 | this.transitionToRoute('index'); 37 | }.bind(this)); 38 | }, 39 | logout: function() { 40 | this.get('session').invalidate().then(function() { 41 | this.transitionToRoute('login'); 42 | }.bind(this)); 43 | } 44 | } 45 | }); 46 | ``` 47 | 48 | ## Credits 49 | 50 | Thanks to [Simplabs](https://github.com/simplabs) for create Ember Simple Auth in the first place! 51 | 52 | ## License 53 | 54 | Released under the MIT License. 55 | -------------------------------------------------------------------------------- /addon/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/addon/.gitkeep -------------------------------------------------------------------------------- /app/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/app/.gitkeep -------------------------------------------------------------------------------- /app/authenticators/firebase.js: -------------------------------------------------------------------------------- 1 | import Base from 'ember-simple-auth/authenticators/base'; 2 | import Firebase from 'firebase'; 3 | import config from '../config/environment'; 4 | 5 | const { Promise } = Ember.RSVP; 6 | 7 | export default Base.extend({ 8 | 9 | init: function() { 10 | if (config.firebase) { 11 | this.set('firebase', new Firebase(config.firebase)); 12 | } else { 13 | throw new Error("'firebase' not defined in environment"); 14 | } 15 | 16 | this._super(); 17 | }, 18 | firebase: null, 19 | restore: function(data) { 20 | 21 | var _this = this; 22 | 23 | return new Promise(function(resolve, reject) { 24 | 25 | if (data.token) { 26 | 27 | _this.get('firebase').authWithCustomToken(data.token, function(error, success) { 28 | Ember.run(function() { 29 | if (error) { 30 | reject(error); 31 | } else { 32 | resolve(success); 33 | } 34 | }); 35 | }); 36 | 37 | } else { 38 | reject(new Error('Unable to restore Firebase session: no token found.')); 39 | } 40 | 41 | }); 42 | 43 | }, 44 | authenticate: function(options) { 45 | var _this = this; 46 | if(options.provider === "password" || !options.provider){ 47 | return new Promise(function(resolve, reject) { 48 | _this.get('firebase').authWithPassword({ 49 | 'email': options.email, 50 | 'password': options.password 51 | }, function(error, authData) { 52 | Ember.run(function() { 53 | if (error) { 54 | reject(error); 55 | } else { 56 | resolve(authData); 57 | } 58 | }); 59 | }); 60 | }); 61 | } else { 62 | return new Promise(function(resolve, reject) { 63 | var callback = function(error, authData) { 64 | Ember.run(function() { 65 | if (error) { 66 | reject(error); 67 | } else { 68 | resolve(authData); 69 | } 70 | }); 71 | }; 72 | if(options.redirect){ 73 | _this.get('firebase').authWithOAuthRedirect(options.provider, callback); 74 | } else { 75 | _this.get('firebase').authWithOAuthPopup(options.provider, callback) 76 | } 77 | }); 78 | } 79 | }, 80 | invalidate: function(data) { 81 | 82 | var _this = this; 83 | 84 | return new Promise(function(resolve, reject) { 85 | _this.get('firebase').unauth(); 86 | resolve(data); 87 | }); 88 | } 89 | }); 90 | -------------------------------------------------------------------------------- /app/initializers/firebase-auth.js: -------------------------------------------------------------------------------- 1 | import FirebaseAuthenticator from '../authenticators/firebase'; 2 | 3 | export default { 4 | name: 'firebase-auth', 5 | before: 'ember-simple-auth', 6 | initialize: function(container, app) { 7 | container.register('authenticator:firebase', FirebaseAuthenticator); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-simple-auth-firebase", 3 | "dependencies": { 4 | "ember": "1.11.1", 5 | "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", 6 | "ember-cli-test-loader": "ember-cli-test-loader#0.1.3", 7 | "ember-data": "1.0.0-beta.16.1", 8 | "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4", 9 | "ember-qunit": "0.3.1", 10 | "ember-qunit-notifications": "0.0.7", 11 | "ember-resolver": "~0.1.15", 12 | "jquery": "^1.11.1", 13 | "loader.js": "ember-cli/loader.js#3.2.0", 14 | "qunit": "~1.17.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 'use strict'; 3 | 4 | module.exports = { 5 | name: 'ember-cli-simple-auth-firebase', 6 | }; 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-simple-auth-firebase", 3 | "version": "1.1.0", 4 | "description": "Firebase Authenticator for Ember Simple Auth", 5 | "directories": { 6 | "doc": "doc", 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "start": "ember server", 11 | "build": "ember build", 12 | "test": "ember try:testall" 13 | }, 14 | "repository": "https://github.com/jamesdixon/ember-cli-simple-auth-firebase", 15 | "engines": { 16 | "node": ">= 0.10.0" 17 | }, 18 | "author": "James Dixon", 19 | "license": "MIT", 20 | "devDependencies": { 21 | "broccoli-asset-rev": "^2.0.2", 22 | "ember-cli": "0.2.3", 23 | "ember-cli-app-version": "0.3.3", 24 | "ember-cli-content-security-policy": "0.4.0", 25 | "ember-cli-dependency-checker": "0.0.8", 26 | "ember-cli-htmlbars": "0.7.4", 27 | "ember-cli-ic-ajax": "0.1.1", 28 | "ember-cli-inject-live-reload": "^1.3.0", 29 | "ember-cli-qunit": "0.3.10", 30 | "ember-cli-uglify": "1.0.1", 31 | "ember-data": "1.0.0-beta.16.1", 32 | "ember-export-application-global": "^1.0.2", 33 | "ember-disable-prototype-extensions": "^1.0.0", 34 | "ember-try": "0.0.4" 35 | }, 36 | "keywords": [ 37 | "ember-addon", 38 | "firebase", 39 | "ember-simple-auth" 40 | ], 41 | "ember-addon": { 42 | "configPath": "tests/dummy/config" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /testem.json: -------------------------------------------------------------------------------- 1 | { 2 | "framework": "qunit", 3 | "test_page": "tests/index.html?hidepassed", 4 | "launch_in_ci": [ 5 | "PhantomJS" 6 | ], 7 | "launch_in_dev": [ 8 | "PhantomJS", 9 | "Chrome" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "location", 6 | "setTimeout", 7 | "$", 8 | "-Promise", 9 | "define", 10 | "console", 11 | "visit", 12 | "exists", 13 | "fillIn", 14 | "click", 15 | "keyEvent", 16 | "triggerEvent", 17 | "find", 18 | "findWithAssert", 19 | "wait", 20 | "DS", 21 | "andThen", 22 | "currentURL", 23 | "currentPath", 24 | "currentRouteName" 25 | ], 26 | "node": false, 27 | "browser": false, 28 | "boss": true, 29 | "curly": false, 30 | "debug": false, 31 | "devel": false, 32 | "eqeqeq": true, 33 | "evil": true, 34 | "forin": false, 35 | "immed": false, 36 | "laxbreak": false, 37 | "newcap": true, 38 | "noarg": true, 39 | "noempty": false, 40 | "nonew": false, 41 | "nomen": false, 42 | "onevar": false, 43 | "plusplus": false, 44 | "regexp": false, 45 | "undef": true, 46 | "sub": true, 47 | "strict": false, 48 | "white": false, 49 | "eqnull": true, 50 | "esnext": true 51 | } 52 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from 'ember/resolver'; 3 | import loadInitializers from 'ember/load-initializers'; 4 | import config from './config/environment'; 5 | 6 | var App; 7 | 8 | Ember.MODEL_FACTORY_INJECTIONS = true; 9 | 10 | App = Ember.Application.extend({ 11 | modulePrefix: config.modulePrefix, 12 | podModulePrefix: config.podModulePrefix, 13 | Resolver: Resolver 14 | }); 15 | 16 | loadInitializers(App, config.modulePrefix); 17 | 18 | export default App; 19 | -------------------------------------------------------------------------------- /tests/dummy/app/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/dummy/app/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/dummy/app/controllers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/controllers/application.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | 5 | actions: { 6 | login: function() { 7 | this.get('session').authenticate('authenticator:firebase', { 8 | 'email': this.get('email'), 9 | 'password': this.get('password') 10 | }).then(function() { 11 | this.transitionToRoute('index'); 12 | }.bind(this)); 13 | }, 14 | logout: function() { 15 | this.get('session').invalidate().then(function() { 16 | this.transitionToRoute('login'); 17 | }.bind(this)); 18 | } 19 | } 20 | }); -------------------------------------------------------------------------------- /tests/dummy/app/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/dummy/app/helpers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | 12 | 13 | 14 | 15 | {{content-for 'head-footer'}} 16 | 17 | 18 | {{content-for 'body'}} 19 | 20 | 21 | 22 | 23 | {{content-for 'body-footer'}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/dummy/app/models/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from './config/environment'; 3 | 4 | var Router = Ember.Router.extend({ 5 | location: config.locationType 6 | }); 7 | 8 | export default Router.map(function() { 9 | }); 10 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/dummy/app/routes/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/routes/application.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin'; 3 | 4 | export default Ember.Route.extend(ApplicationRouteMixin); -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/dummy/app/styles/app.css -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 | {{outlet}} 2 | 3 | {{#if session.isAuthenticated}} 4 |

Authenticated!

5 | Logout 6 | {{else}} 7 | 8 |
9 |
10 |
11 |
12 |
13 | {{input value=email type="email" placeholder="email" class="form-control no-border"}} 14 |
15 |
16 | {{input value=password type="password" placeholder="password" class="form-control no-border"}} 17 |
18 |
19 | 20 | 21 |
22 |

Do not have an account?

23 | Create an account 24 |
25 | 26 | {{/if}} -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/dummy/app/templates/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/dummy/app/views/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function(environment) { 4 | var ENV = { 5 | modulePrefix: 'dummy', 6 | environment: environment, 7 | baseURL: '/', 8 | locationType: 'auto', 9 | contentSecurityPolicy: { 10 | 'default-src': "'none'", 11 | 'script-src': "'self' 'unsafe-inline' 'unsafe-eval' https://**.firebaseio.com", 12 | 'font-src': "'self'", 13 | 'connect-src': "'self' wss://*.firebaseio.com https://*.firebase.com", 14 | 'img-src': "'self'", 15 | 'report-uri':"'localhost'", 16 | 'style-src': "'self' 'unsafe-inline'", 17 | 'frame-src': "'none'" 18 | }, 19 | firebase: 'https://ember-playground.firebaseio.com/', 20 | EmberENV: { 21 | FEATURES: { 22 | // Here you can enable experimental features on an ember canary build 23 | // e.g. 'with-controller': true 24 | } 25 | }, 26 | 27 | APP: { 28 | // Here you can pass flags/options to your application instance 29 | // when it is created 30 | } 31 | }; 32 | 33 | if (environment === 'development') { 34 | // ENV.APP.LOG_RESOLVER = true; 35 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 36 | // ENV.APP.LOG_TRANSITIONS = true; 37 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 38 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 39 | } 40 | 41 | if (environment === 'test') { 42 | // Testem prefers this... 43 | ENV.baseURL = '/'; 44 | ENV.locationType = 'none'; 45 | 46 | // keep test console output quieter 47 | ENV.APP.LOG_ACTIVE_GENERATION = false; 48 | ENV.APP.LOG_VIEW_LOOKUPS = false; 49 | 50 | ENV.APP.rootElement = '#ember-testing'; 51 | } 52 | 53 | if (environment === 'production') { 54 | 55 | } 56 | 57 | return ENV; 58 | }; 59 | -------------------------------------------------------------------------------- /tests/dummy/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember/resolver'; 2 | import config from '../../config/environment'; 3 | 4 | var resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Application from '../../app'; 3 | import Router from '../../router'; 4 | import config from '../../config/environment'; 5 | 6 | export default function startApp(attrs) { 7 | var application; 8 | 9 | var attributes = Ember.merge({}, config.APP); 10 | attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; 11 | 12 | Ember.run(function() { 13 | application = Application.create(attributes); 14 | application.setupForTesting(); 15 | application.injectTestHelpers(); 16 | }); 17 | 18 | return application; 19 | } 20 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy Tests 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | {{content-for 'test-head'}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for 'head-footer'}} 18 | {{content-for 'test-head-footer'}} 19 | 20 | 21 | 22 | {{content-for 'body'}} 23 | {{content-for 'test-body'}} 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for 'body-footer'}} 31 | {{content-for 'test-body-footer'}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { 3 | setResolver 4 | } from 'ember-qunit'; 5 | 6 | setResolver(resolver); 7 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesdixon/ember-cli-simple-auth-firebase/10d98f5beda288ae11a774a0d6d12000b7637125/tests/unit/.gitkeep --------------------------------------------------------------------------------