mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
14 lines
436 B
CoffeeScript
14 lines
436 B
CoffeeScript
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"
|