Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import OsfAdapter from './osf-adapter'; | ||
|
||
export default OsfAdapter.extend({ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import DS from 'ember-data'; | ||
|
||
import OsfModel from './osf-model'; | ||
|
||
/** | ||
* @module ember-osf | ||
* @submodule models | ||
*/ | ||
|
||
/** | ||
* Model for OSF APIv2 subscriptions. | ||
* @class Subscription | ||
*/ | ||
export default OsfModel.extend({ | ||
eventName: DS.attr('string'), | ||
frequency: DS.attr('string'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import OsfSerializer from './osf-serializer'; | ||
|
||
export default OsfSerializer.extend({ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-osf/adapters/subscription'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-osf/models/subscription'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-osf/serializers/subscription'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { moduleForModel, test } from 'ember-qunit'; | ||
|
||
moduleForModel('subscription', 'Unit | Model | contributor', { | ||
// Specify the other units that are required for this test. | ||
needs: [ | ||
'transform:links', | ||
'transform:embed', | ||
] | ||
}); | ||
|
||
test('it exists', function(assert) { | ||
let model = this.subject(); | ||
assert.ok(!!model); | ||
}); | ||
|
||
test('it has an attribute: frequency', function(assert) { | ||
var model = this.subject(); | ||
var hasAttr = Object.keys(model.toJSON()).indexOf('frequency') > -1; | ||
assert.ok(hasAttr); | ||
}); | ||
|
||
test('it has an attribute: eventName', function(assert) { | ||
var model = this.subject(); | ||
var hasAttr = Object.keys(model.toJSON()).indexOf('eventName') > -1; | ||
assert.ok(hasAttr); | ||
}); |