summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2014-03-26 21:07:40 +0100
committerThomas Tanghus <thomas@tanghus.net>2014-03-26 21:07:40 +0100
commite2dfa6378160fcba74a2bdbad7f593bcd4e93130 (patch)
treed1a7d826a790be7e27b79cc5c0bf50da4f6cfc46 /js/tests
parent921a21bb9ccb200c4dba1930b984a7e1edb2a888 (diff)
Update requests to use the full route. Refs. #496
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/services/persistenceSpec.coffee64
1 files changed, 32 insertions, 32 deletions
diff --git a/js/tests/services/persistenceSpec.coffee b/js/tests/services/persistenceSpec.coffee
index fd84a1757..baf03c366 100644
--- a/js/tests/services/persistenceSpec.coffee
+++ b/js/tests/services/persistenceSpec.coffee
@@ -71,7 +71,7 @@ describe 'Persistence', ->
limit: @config.itemBatchSize
offset: 3
- expect(@req.get).toHaveBeenCalledWith('news_items', expected)
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/items', expected)
it 'should reset the autopage lock when loading a new feed', =>
@@ -125,7 +125,7 @@ describe 'Persistence', ->
@Persistence.getNewItems(params.data.type, params.data.id,
params.data.lastModified, success)
- expect(@req.get).toHaveBeenCalledWith('news_items_new', params)
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/items/new', params)
it 'send a correct star item request', =>
@@ -136,7 +136,7 @@ describe 'Persistence', ->
@Persistence.starItem(params.routeParams.feedId, params.routeParams.guidHash)
- expect(@req.post).toHaveBeenCalledWith('news_items_star', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/items/{feedId}/{guidHash}/star', params)
it 'send a correct unstar item request', =>
@@ -148,7 +148,7 @@ describe 'Persistence', ->
@Persistence.unstarItem(params.routeParams.feedId,
params.routeParams.guidHash)
- expect(@req.post).toHaveBeenCalledWith('news_items_unstar', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/items/{feedId}/{guidHash}/unstar', params)
it 'send a correct read item request', =>
@@ -159,7 +159,7 @@ describe 'Persistence', ->
@Persistence.readItem(params.routeParams.itemId)
- expect(@req.post).toHaveBeenCalledWith('news_items_read', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/items/{itemId}/read', params)
it 'send a correct unread item request', =>
@@ -169,10 +169,10 @@ describe 'Persistence', ->
@Persistence.unreadItem(params.routeParams.itemId)
- expect(@req.post).toHaveBeenCalledWith('news_items_unread', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/items/{itemId}/unread', params)
- it 'shoud send a correct request for marking all items read', =>
+ it 'should send a correct request for marking all items read', =>
params =
data:
highestItemId: 4
@@ -195,7 +195,7 @@ describe 'Persistence', ->
onSuccess: jasmine.any(Function)
onFailure: jasmine.any(Function)
- expect(@req.get).toHaveBeenCalledWith('news_feeds', expected)
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/feeds', expected)
it 'should not show loading sign if disabled', =>
@@ -213,7 +213,7 @@ describe 'Persistence', ->
@Persistence.moveFeed(params.routeParams.feedId, params.data.parentFolderId)
- expect(@req.post).toHaveBeenCalledWith('news_feeds_move', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/feeds/{feedId}/move', params)
it 'create a correct request for renaming a feed', =>
@@ -225,7 +225,7 @@ describe 'Persistence', ->
@Persistence.renameFeed(params.routeParams.feedId, params.data.feedTitle)
- expect(@req.post).toHaveBeenCalledWith('news_feeds_rename', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/feeds/{feedId}/rename', params)
it 'shoud send a correct request for marking all items of a feed read', =>
@@ -238,7 +238,7 @@ describe 'Persistence', ->
@Persistence.setFeedRead(params.routeParams.feedId, params.data.highestItemId)
- expect(@req.post).toHaveBeenCalledWith('news_feeds_read', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/feeds/{feedId}/read', params)
it 'send a correct feed update request', =>
@@ -248,7 +248,7 @@ describe 'Persistence', ->
@Persistence.updateFeed(params.routeParams.feedId)
- expect(@req.post).toHaveBeenCalledWith('news_feeds_update', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/feeds/{feedId}/update', params)
it 'send a correct get active feed request', =>
@@ -261,7 +261,7 @@ describe 'Persistence', ->
onSuccess: jasmine.any(Function)
onFailure: jasmine.any(Function)
- expect(@req.get).toHaveBeenCalledWith('news_feeds_active', expected)
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/feeds/active', expected)
it 'send a correct feed delete request', =>
@@ -271,7 +271,7 @@ describe 'Persistence', ->
@Persistence.deleteFeed(params.routeParams.feedId)
- expect(@req.delete).toHaveBeenCalledWith('news_feeds_delete', params)
+ expect(@req.delete).toHaveBeenCalledWith('/apps/news/feeds/{feedId}', params)
it 'send a correct feed restore request', =>
@@ -282,7 +282,7 @@ describe 'Persistence', ->
@Persistence.restoreFeed(params.routeParams.feedId, params.onSuccess)
- expect(@req.post).toHaveBeenCalledWith('news_feeds_restore', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/feeds/{feedId}/restore', params)
it 'send a correct feed create request', =>
@@ -296,7 +296,7 @@ describe 'Persistence', ->
@Persistence.createFeed(params.data.url, params.data.parentFolderId,
params.onSuccess, params.onFailure)
- expect(@req.post).toHaveBeenCalledWith('news_feeds_create', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/feeds', params)
it 'should do a proper import articles request', =>
@@ -308,7 +308,7 @@ describe 'Persistence', ->
@Persistence.importArticles(params.data.json, ->)
- expect(@req.post).toHaveBeenCalledWith('news_feeds_import_articles',
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/feeds/import/articles',
params)
@@ -325,7 +325,7 @@ describe 'Persistence', ->
onSuccess: jasmine.any(Function)
onFailure: jasmine.any(Function)
- expect(@req.get).toHaveBeenCalledWith('news_folders', expected)
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/folders', expected)
it 'send a correct collapse folder request', =>
@@ -335,7 +335,7 @@ describe 'Persistence', ->
@Persistence.collapseFolder(params.routeParams.folderId)
- expect(@req.post).toHaveBeenCalledWith('news_folders_collapse', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/folders/{folderId}/collapse', params)
it 'send a correct open folder request', =>
@@ -345,7 +345,7 @@ describe 'Persistence', ->
@Persistence.openFolder(params.routeParams.folderId)
- expect(@req.post).toHaveBeenCalledWith('news_folders_open', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/folders/{folderId}/open', params)
it 'should do a proper folder create request', =>
@@ -359,7 +359,7 @@ describe 'Persistence', ->
@Persistence.createFolder(params.data.folderName, params.data.parentFolderId,
params.onSuccess, params.onFailure)
- expect(@req.post).toHaveBeenCalledWith('news_folders_create', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/folders/create', params)
it 'should do a proper folder delete request', =>
@@ -369,7 +369,7 @@ describe 'Persistence', ->
@Persistence.deleteFolder(params.routeParams.folderId)
- expect(@req.delete).toHaveBeenCalledWith('news_folders_delete', params)
+ expect(@req.delete).toHaveBeenCalledWith('/apps/news/folders/{folderId}', params)
it 'send a correct folder restore request', =>
@@ -380,7 +380,7 @@ describe 'Persistence', ->
@Persistence.restoreFolder(params.routeParams.folderId, params.onSuccess)
- expect(@req.post).toHaveBeenCalledWith('news_folders_restore', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/folders/{folderId}/restore', params)
it 'should do a proper folder rename request', =>
@@ -392,7 +392,7 @@ describe 'Persistence', ->
@Persistence.renameFolder(params.routeParams.folderId, params.data.folderName)
- expect(@req.post).toHaveBeenCalledWith('news_folders_rename', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/folders/{folderId}/rename', params)
it 'shoud send a correct request for marking all items of a folders read', =>
@@ -406,7 +406,7 @@ describe 'Persistence', ->
params.data.highestItemId)
- expect(@req.post).toHaveBeenCalledWith('news_folders_read', params)
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/folders/{folderId}/read', params)
###
@@ -415,7 +415,7 @@ describe 'Persistence', ->
it 'should have an export request', =>
@Persistence.exportOPML()
- expect(@req.get).toHaveBeenCalledWith('news_export_opml')
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/export/opml')
###
@@ -432,7 +432,7 @@ describe 'Persistence', ->
onSuccess: jasmine.any(Function)
onFailure: jasmine.any(Function)
- expect(@req.get).toHaveBeenCalledWith('news_usersettings_read', expected)
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/usersettings/read', expected)
@@ -442,7 +442,7 @@ describe 'Persistence', ->
@Persistence.userSettingsReadShow(params.onSuccess)
- expect(@req.post).toHaveBeenCalledWith('news_usersettings_read_show',
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/usersettings/read/show',
params)
@@ -451,7 +451,7 @@ describe 'Persistence', ->
onSuccess: ->
@Persistence.userSettingsReadHide(params.onSuccess)
- expect(@req.post).toHaveBeenCalledWith('news_usersettings_read_hide',
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/usersettings/read/hide',
params)
@@ -465,14 +465,14 @@ describe 'Persistence', ->
onSuccess: jasmine.any(Function)
onFailure: jasmine.any(Function)
- expect(@req.get).toHaveBeenCalledWith('news_usersettings_language',
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/usersettings/language',
expected)
it 'should send a get compact view request', =>
@Persistence.userSettingsIsCompact()
- expect(@req.get).toHaveBeenCalledWith('news_usersettings_iscompact')
+ expect(@req.get).toHaveBeenCalledWith('/apps/news/usersettings/compact')
it 'should send a set compact view request', =>
@@ -482,7 +482,7 @@ describe 'Persistence', ->
data:
compact: true
- expect(@req.post).toHaveBeenCalledWith('news_usersettings_setcompact',
+ expect(@req.post).toHaveBeenCalledWith('/apps/news/usersettings/compact',
expected)