add sound model
authornowmad@nowmads-macbook-pro.local
Thu, 10 Dec 2015 16:47:51 +0100
changeset 40 9887379e627f
parent 39 c693e8673d5b
child 41 b6815b3d46bd
add sound model
cms/app-client/app/models/sound.js
cms/app-client/tests/unit/models/sound-test.js
cms/app-client/tests/unit/routes/sound-test.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/models/sound.js	Thu Dec 10 16:47:51 2015 +0100
@@ -0,0 +1,37 @@
+import DS from 'ember-data';
+
+var Sound = DS.Model.extend({
+  name: DS.attr('string'),
+  audio: DS.attr('url')
+});
+
+Sound.reopenClass({
+  FIXTURES: [
+    {
+          id: 1,
+          name: "Sound 1",
+          location: "france",
+          language: "alsacien",
+          datetime: 1990,
+          audio: "http://sound1.mp3"
+      },
+      {
+          id: 2,
+          name: "Sound 2",
+          location: "france",
+          language: "breton",
+          datetime: 1965,
+          audio: "http://sound2.mp3"
+      },
+      {
+          id: 3,
+          name: "Sound 3",
+          location: "spain",
+          language: "judeo-espagnol",
+          datetime: 2002,
+          audio: "http://sound3.mp3"
+      }
+  ]
+});
+
+export default Sound;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/models/sound-test.js	Thu Dec 10 16:47:51 2015 +0100
@@ -0,0 +1,12 @@
+import { moduleForModel, test } from 'ember-qunit';
+
+moduleForModel('sound', 'Unit | Model | sound', {
+  // Specify the other units that are required for this test.
+  needs: []
+});
+
+test('it exists', function(assert) {
+  var model = this.subject();
+  // var store = this.store();
+  assert.ok(!!model);
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/routes/sound-test.js	Thu Dec 10 16:47:51 2015 +0100
@@ -0,0 +1,11 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('route:sound', 'Unit | Route | sound', {
+  // 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);
+});