diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-09 16:52:04 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-09 22:52:27 +0200 |
commit | 3b5d012b57774420049408b96aa64282f0d34609 (patch) | |
tree | ac43b03d4b4c0df0e6158e6fa33f329ec831205d /js/tests/services | |
parent | 6e0de4208c06a3c95cbe274a93476b6b7eacafa0 (diff) |
fix user settings request
Diffstat (limited to 'js/tests/services')
-rw-r--r-- | js/tests/services/persistenceSpec.coffee | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/js/tests/services/persistenceSpec.coffee b/js/tests/services/persistenceSpec.coffee index 083ce0f5d..a38668f4c 100644 --- a/js/tests/services/persistenceSpec.coffee +++ b/js/tests/services/persistenceSpec.coffee @@ -420,58 +420,36 @@ describe 'Persistence', -> ### USERSETTINGS CONTROLLER ### - it 'should do a proper get user settings read request', => - - params = - onSuccess: -> - - @Persistence.userSettingsRead(params.onSuccess) - - expected = - onSuccess: jasmine.any(Function) - onFailure: jasmine.any(Function) - - expect(@req.get).toHaveBeenCalledWith('/apps/news/usersettings/read', expected) - - - it 'should do a proper user settings read show request', => params = onSuccess: -> + data: + showAll: true @Persistence.userSettingsReadShow(params.onSuccess) - expect(@req.post).toHaveBeenCalledWith('/apps/news/usersettings/read/show', + expect(@req.post).toHaveBeenCalledWith('/apps/news/settings', params) it 'should do a proper user settings read hide request', => params = onSuccess: -> + data: + showAll: false + @Persistence.userSettingsReadHide(params.onSuccess) - expect(@req.post).toHaveBeenCalledWith('/apps/news/usersettings/read/hide', + expect(@req.post).toHaveBeenCalledWith('/apps/news/settings', params) - it 'should do a proper user settings language request', => - params = - onSuccess: -> - - @Persistence.userSettingsLanguage(params.onSuccess) - - expected = - onSuccess: jasmine.any(Function) - onFailure: jasmine.any(Function) - - expect(@req.get).toHaveBeenCalledWith('/apps/news/usersettings/language', - expected) - it 'should send a get compact view request', => - @Persistence.userSettingsIsCompact() + it 'should send a get settings request', => + @Persistence.getSettings() - expect(@req.get).toHaveBeenCalledWith('/apps/news/usersettings/compact') + expect(@req.get).toHaveBeenCalledWith('/apps/news/settings') it 'should send a set compact view request', => @@ -480,8 +458,9 @@ describe 'Persistence', -> expected = data: compact: true + onSuccess: jasmine.any(Function) - expect(@req.post).toHaveBeenCalledWith('/apps/news/usersettings/compact', + expect(@req.post).toHaveBeenCalledWith('/apps/news/settings', expected) |