diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2013-12-19 15:15:32 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2013-12-19 15:15:32 +0100 |
commit | 6dc8dad23eea121989e0a89a67e92091802857a0 (patch) | |
tree | 15d6b5eda5fece8bf691d5ef8662f697b56b7073 /js/tests/services | |
parent | 28d28d8c9eb5ed9f184b572cfd16994c024e4227 (diff) |
add persistent option for compact view
Diffstat (limited to 'js/tests/services')
-rw-r--r-- | js/tests/services/compactSpec.coffee | 44 | ||||
-rw-r--r-- | js/tests/services/persistenceSpec.coffee | 17 |
2 files changed, 61 insertions, 0 deletions
diff --git a/js/tests/services/compactSpec.coffee b/js/tests/services/compactSpec.coffee new file mode 100644 index 000000000..34a1db462 --- /dev/null +++ b/js/tests/services/compactSpec.coffee @@ -0,0 +1,44 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt dev@bernhard-posselt.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 'Compact', -> + + beforeEach module 'News' + + beforeEach inject (@Compact) => + @data = true + + + it 'should be false by default', => + expect(@Compact.isCompact()).toBe(false) + + + it 'should set the correct compact', => + @Compact.handle(@data) + expect(@Compact.isCompact()).toBe(true) + + + it 'should set the correct compact', => + @data = false + @Compact.handle(@data) + expect(@Compact.isCompact()).toBe(false)
\ No newline at end of file diff --git a/js/tests/services/persistenceSpec.coffee b/js/tests/services/persistenceSpec.coffee index 708a68b07..b9250b974 100644 --- a/js/tests/services/persistenceSpec.coffee +++ b/js/tests/services/persistenceSpec.coffee @@ -429,3 +429,20 @@ describe 'Persistence', -> expect(@req.get).toHaveBeenCalledWith('news_usersettings_language', expected) + + + it 'should send a get compact view request', => + @Persistence.userSettingsIsCompact() + + expect(@req.get).toHaveBeenCalledWith('news_usersettings_iscompact') + + + it 'should send a set compact view request', => + @Persistence.userSettingsSetCompact(true) + + expected = + data: + compact: true + + expect(@req.post).toHaveBeenCalledWith('news_usersettings_setcompact', + expected) |