mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Extract fetch-by-page from BPE to service
This commit is contained in:
13
spec/javascripts/unit/admin/services/paged_fetcher.js.coffee
Normal file
13
spec/javascripts/unit/admin/services/paged_fetcher.js.coffee
Normal file
@@ -0,0 +1,13 @@
|
||||
describe "PagedFetcher service", ->
|
||||
PagedFetcher = null
|
||||
|
||||
beforeEach ->
|
||||
module "ofn.admin"
|
||||
|
||||
beforeEach inject (_PagedFetcher_) ->
|
||||
PagedFetcher = _PagedFetcher_
|
||||
|
||||
describe "substituting a page in the URL", ->
|
||||
it "replaces ::page:: with the given page number", ->
|
||||
expect(PagedFetcher.urlForPage("http://example.com/foo?page=::page::&per_page=20", 12)).
|
||||
toEqual "http://example.com/foo?page=12&per_page=20"
|
||||
Reference in New Issue
Block a user