Skip to content

Commit

Permalink
Closes #102
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Brown committed Feb 19, 2015
1 parent 83054b8 commit 0d91357
Show file tree
Hide file tree
Showing 21 changed files with 380 additions and 395 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@
/libpeerconnection.log
npm-debug.log
testem.log
*.swp
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"predef": [
"document",
"window",
"-Promise"
"-Promise",
"require"
],
"browser": true,
"boss": true,
Expand Down
12 changes: 12 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bower_components/
tests/

.bowerrc
.editorconfig
.ember-cli
.travis.yml
.npmignore
**/.gitkeep
bower.json
Brocfile.js
testem.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

[![Latest Release](https://img.shields.io/github/release/softlayer/sl-ember-store.svg)](https://github.com/softlayer/sl-ember-store/releases) ![Ember CLI version](https://img.shields.io/badge/ember%20cli-0.1.5-orange.svg) [![License](https://img.shields.io/npm/l/sl-ember-store.svg)](LICENSE.md) [![Downloads](https://img.shields.io/npm/dm/sl-ember-store.svg)](https://www.npmjs.com/package/sl-ember-store)
[![Latest Release](https://img.shields.io/github/release/softlayer/sl-ember-store.svg)](https://github.com/softlayer/sl-ember-store/releases) ![Ember CLI version](https://img.shields.io/badge/ember%20cli-0.1.15-orange.svg) [![License](https://img.shields.io/npm/l/sl-ember-store.svg)](LICENSE.md) [![Downloads](https://img.shields.io/npm/dm/sl-ember-store.svg)](https://www.npmjs.com/package/sl-ember-store)

[![Dependencies](https://img.shields.io/david/softlayer/sl-ember-store.svg)](https://david-dm.org/softlayer/sl-ember-store) [![Dev Dependencies](https://img.shields.io/david/dev/softlayer/sl-ember-store.svg)](https://david-dm.org/softlayer/sl-ember-store#info=devDependencies)

Expand Down
3 changes: 2 additions & 1 deletion addon/adapters/ajax.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Ember from 'ember';
import Adapter from '../adapter';
module icAjax from 'ic-ajax';

var icAjax = require( 'ic-ajax' );

/**
* @module adapters
Expand Down
14 changes: 7 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"jquery": "^1.11.1",
"ember": "1.8.1",
"ember-resolver": "~0.1.11",
"loader.js": "stefanpenner/loader.js#1.0.1",
"ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4",
"ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2",
"ember-qunit": "0.1.8",
"ember-qunit-notifications": "0.0.4",
"qunit": "~1.15.0",
"loader.js": "ember-cli/loader.js#1.0.1",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.1",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2",
"ember-qunit": "0.2.8",
"ember-qunit-notifications": "0.0.7",
"qunit": "~1.17.1",
"pretender": "0.1.0",
"es5-shim": "^4.0.5"
},
Expand Down
15 changes: 9 additions & 6 deletions package.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,22 @@
"broccoli-asset-rev": "^2.0.0",
"broccoli-ember-hbs-template-compiler": "^1.6.1",
"broccoli-static-compiler": "~0.2.1",
"broccoli-string-replace": "0.0.2",
"connect-restreamer": "^1.0.1",
"ember-cli": "0.1.5",
"ember-cli": "0.1.15",
"ember-cli-app-version": "0.3.1",
"ember-cli-babel": "^4.0.0",
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-es5-shim": "~0.1.0",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-pretender": "^0.3.1",
"ember-cli-qunit": "0.1.2",
"ember-export-application-global": "^1.0.0",
"ember-cli-qunit": "0.3.7",
"ember-cli-uglify": "1.0.1",
"ember-export-application-global": "^1.0.2",
"express": "^4.8.5",
"glob": "^4.0.5",
"morgan": "^1.5.0",
"ember-cli-es5-shim": "~0.1.0",
"broccoli-string-replace": "0.0.2"
"morgan": "^1.5.0"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down
2 changes: 1 addition & 1 deletion testem.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"framework": "qunit",
"test_page": "tests/index.html",
"test_page": "tests/index.html?hidepassed",
"launch_in_ci": [
"PhantomJS"
],
Expand Down
30 changes: 5 additions & 25 deletions tests/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,8 @@
"setTimeout",
"$",
"-Promise",
"QUnit",
"define",
"console",
"equal",
"notEqual",
"notStrictEqual",
"test",
"asyncTest",
"testBoth",
"testWithDefault",
"raises",
"throws",
"deepEqual",
"start",
"stop",
"ok",
"strictEqual",
"module",
"moduleFor",
"moduleForComponent",
"moduleForModel",
"process",
"expect",
"visit",
"exists",
"fillIn",
Expand All @@ -39,14 +18,15 @@
"findWithAssert",
"wait",
"DS",
"isolatedContainer",
"startApp",
"andThen",
"currentURL",
"currentPath",
"currentRouteName",
"propEqual",
"sinon"
"sinon",
"require",
"module",
"asyncTest",
"start"
],
"node": false,
"browser": false,
Expand Down
10 changes: 5 additions & 5 deletions tests/acceptance/array-of-models-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import { test, moduleFor } from 'ember-qunit';
var App;

module('Acceptance: ArrayOfModels', {
setup: function() {
beforeEach: function() {
App = startApp();
},
teardown: function() {
afterEach: function() {
Ember.run(App, 'destroy');
}
});

test('visiting /arrayOfModels', function() {
test('visiting /arrayOfModels', function( assert ) {
visit('/demos/arrayOfModels');

andThen(function() {
var arrayModelController = App.__container__.lookup('controller:demos/arrayOfModels');
equal(currentPath(), 'demos.arrayOfModels');
ok( arrayModelController.get('model.0') instanceof Foo, 'Controllers model is instance of Foo' );
assert.equal(currentPath(), 'demos.arrayOfModels');
assert.ok( arrayModelController.get('model.0') instanceof Foo, 'Controllers model is instance of Foo' );

});
});
10 changes: 5 additions & 5 deletions tests/acceptance/single-model-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import { test, moduleFor } from 'ember-qunit';
var App;

module( 'Acceptance: SingleModel', {
setup: function() {
beforeEach: function() {
App = startApp();
},
teardown: function() {
afterEach: function() {
Ember.run(App, 'destroy');
}
});

test('visiting /singleModel', function() {
test('visiting /singleModel', function( assert ) {
visit('/demos/singleModel/1');

andThen(function() {
var singleModelController = App.__container__.lookup('controller:demos/singleModel');
equal(currentPath(), 'demos.singleModel');
ok( singleModelController.get('model') instanceof Foo, 'Controllers model is instance of Foo' );
assert.equal(currentPath(), 'demos.singleModel');
assert.ok( singleModelController.get('model') instanceof Foo, 'Controllers model is instance of Foo' );
});
});
3 changes: 3 additions & 0 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ module.exports = function(environment) {
ENV.APP.LOG_VIEW_LOOKUPS = false;

ENV.APP.rootElement = '#ember-testing';

// Per https://github.com/emberjs/data/pull/1952, this resolves instanceOf checks
ENV.APP.MODEL_FACTORY_INJECTIONS = false;
}

if (environment === 'production') {
Expand Down
21 changes: 6 additions & 15 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,12 @@
<link rel="stylesheet" href="assets/dummy.css">
<link rel="stylesheet" href="assets/test-support.css">
<style>
#ember-testing-container {
position: absolute;
background: white;
bottom: 0;
right: 0;
width: 640px;
height: 384px;
overflow: auto;
z-index: 9999;
border: 1px solid #ccc;
opacity: 0.4;
}
#ember-testing {
zoom: 50%;
}
#ember-testing-container {
opacity: 0.4;
}
#ember-testing {
zoom: 50%;
}
</style>

{{content-for 'head-footer'}}
Expand Down
6 changes: 0 additions & 6 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ import {
} from 'ember-qunit';

setResolver(resolver);

document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');

QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
var containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible';
document.getElementById('ember-testing-container').style.visibility = containerVisibility;
20 changes: 10 additions & 10 deletions tests/unit/adapters-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var adapter,
};

module( 'Unit - sl-ember-store/adapter', {
setup: function() {
beforeEach: function() {
adapter = Adapter.create({
container:{
lookup: function( type ){
Expand All @@ -21,26 +21,26 @@ module( 'Unit - sl-ember-store/adapter', {
}
});
},
teardown: function() {
afterEach: function() {
store.runPostQueryHooks.reset();
store.runPreQueryHooks.reset();
}
});
test( 'runPreQueryHooks should run the prequeryhook once', function() {
test( 'runPreQueryHooks should run the prequeryhook once', function( assert ) {
adapter.runPreQueryHooks();
ok( store.runPreQueryHooks.calledOnce );
assert.ok( store.runPreQueryHooks.calledOnce );
});

test( 'runPreQueryHooks should not have run postqueryhook', function() {
test( 'runPreQueryHooks should not have run postqueryhook', function( assert ) {
adapter.runPreQueryHooks();
equal( store.runPostQueryHooks.callCount,0 );
assert.equal( store.runPostQueryHooks.callCount,0 );
});

test( 'runPostQueryHooks should run the postqueryhook once', function() {
test( 'runPostQueryHooks should run the postqueryhook once', function( assert ) {
adapter.runPostQueryHooks();
ok( store.runPostQueryHooks.calledOnce );
assert.ok( store.runPostQueryHooks.calledOnce );
});
test( 'runPostQueryHooks should not have run the prequeryhook', function() {
test( 'runPostQueryHooks should not have run the prequeryhook', function( assert ) {
adapter.runPostQueryHooks();
equal( store.runPreQueryHooks.callCount,0 );
assert.equal( store.runPreQueryHooks.callCount,0 );
});
Loading

0 comments on commit 0d91357

Please sign in to comment.