diff options
Diffstat (limited to 'js/tests/services/models')
-rw-r--r-- | js/tests/services/models/feedmodelSpec.coffee | 46 | ||||
-rw-r--r-- | js/tests/services/models/foldermodelSpec.coffee | 32 | ||||
-rw-r--r-- | js/tests/services/models/itemmodelSpec.coffee | 32 |
3 files changed, 110 insertions, 0 deletions
diff --git a/js/tests/services/models/feedmodelSpec.coffee b/js/tests/services/models/feedmodelSpec.coffee new file mode 100644 index 000000000..faa95d36a --- /dev/null +++ b/js/tests/services/models/feedmodelSpec.coffee @@ -0,0 +1,46 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt nukeawhale@gmail.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU AFFERO GENERAL PUBLIC LICENSE for more details. + +You should have received a copy of the GNU Affero General Public +License along with this library. If not, see <http://www.gnu.org/licenses/>. + +### + + +describe '_FeedModel', -> + + + beforeEach module 'News' + + beforeEach inject (@_FeedModel, @_Model) => + + + it 'should extend model', => + expect(new @_FeedModel instanceof @_Model).toBeTruthy() + + + it 'should bind an imagepath to the item if the url is empty', => + item = + id: 3 + icon: 'url()' + utils = + imagePath: jasmine.createSpy('utils') + + model = new @_FeedModel(utils) + model.add(item) + + expect(utils.imagePath).toHaveBeenCalledWith('news', 'rss.svg')
\ No newline at end of file diff --git a/js/tests/services/models/foldermodelSpec.coffee b/js/tests/services/models/foldermodelSpec.coffee new file mode 100644 index 000000000..3cae0064c --- /dev/null +++ b/js/tests/services/models/foldermodelSpec.coffee @@ -0,0 +1,32 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt nukeawhale@gmail.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU AFFERO GENERAL PUBLIC LICENSE for more details. + +You should have received a copy of the GNU Affero General Public +License along with this library. If not, see <http://www.gnu.org/licenses/>. + +### + +describe '_FolderModel', -> + + + beforeEach module 'News' + + beforeEach inject (@_FolderModel, @_Model) => + + + it 'should extend model', => + expect(new @_FolderModel instanceof @_Model).toBeTruthy()
\ No newline at end of file diff --git a/js/tests/services/models/itemmodelSpec.coffee b/js/tests/services/models/itemmodelSpec.coffee new file mode 100644 index 000000000..061f84f01 --- /dev/null +++ b/js/tests/services/models/itemmodelSpec.coffee @@ -0,0 +1,32 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt nukeawhale@gmail.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU AFFERO GENERAL PUBLIC LICENSE for more details. + +You should have received a copy of the GNU Affero General Public +License along with this library. If not, see <http://www.gnu.org/licenses/>. + +### + +describe '_ItemModel', -> + + + beforeEach module 'News' + + beforeEach inject (@_ItemModel, @_Model) => + + + it 'should extend model', => + expect(new @_ItemModel instanceof @_Model).toBeTruthy()
\ No newline at end of file |