# HG changeset patch # User nowmad@nowmads-macbook-pro.local # Date 1449762653 -3600 # Node ID 7d091abf82fdb71ca697f7338182b6c14f45328a # Parent b6815b3d46bd9798cadd2126f6d8646048600e92 add application adapter to simulate REST, using fixtures diff -r b6815b3d46bd -r 7d091abf82fd cms/app-client/app/adapters/application.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/adapters/application.js Thu Dec 10 16:50:53 2015 +0100 @@ -0,0 +1,16 @@ +import DS from 'ember-data'; + +export default DS.FixtureAdapter.extend({ + host: 'http://127.0.0.1', + namespace: 'api', + queryFixtures: function(records, query, type) { + return records.filter(function(record) { + for(var key in query) { + if (!query.hasOwnProperty(key)) { continue; } + var value = query[key]; + if (record[key] !== value) { return false; } + } + return true; + }); + } +}); diff -r b6815b3d46bd -r 7d091abf82fd cms/app-client/app/routes/application.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/routes/application.js Thu Dec 10 16:50:53 2015 +0100 @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model() { + return this.store.findAll('sound'); + } +}); diff -r b6815b3d46bd -r 7d091abf82fd cms/app-client/tests/unit/adapters/application-test.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/tests/unit/adapters/application-test.js Thu Dec 10 16:50:53 2015 +0100 @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:application', 'Unit | Adapter | application', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + var adapter = this.subject(); + assert.ok(adapter); +}); diff -r b6815b3d46bd -r 7d091abf82fd cms/app-client/tests/unit/routes/application-test.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/tests/unit/routes/application-test.js Thu Dec 10 16:50:53 2015 +0100 @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:application', 'Unit | Route | application', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + var route = this.subject(); + assert.ok(route); +});