Skip to content

Commit

Permalink
refactor(test): adjust test for all()
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenko committed Apr 29, 2016
1 parent 71dc7d0 commit f2d7394
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/spec/client/services/base.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@ describe 'Service', ->
it 'should throw if perPage < 0', ->
expect(=> @service.perPage(-1)).toThrow new Error 'PerPage (limit) must be a number >= 0'

it 'should alias \'all\' for \'perPage(0)\'', ->
spyOn(@service, 'perPage')
@service.perPage(0)
expect(@service.perPage).toHaveBeenCalledWith 0
it 'should set flag for \'all\'', ->
@service.all()
expect(@service._fetchAll).toBe(true)

it 'should build query string', ->
queryString = @service
Expand Down Expand Up @@ -207,7 +206,7 @@ describe 'Service', ->
it 'should not use PAGED request when queryString is set', ->
spyOn(@restMock, 'PAGED')
spyOn(@restMock, 'GET')
@service.byQueryString('limit=10').perPage(0).fetch()
@service.byQueryString('limit=10').all().fetch()
expect(@restMock.PAGED).not.toHaveBeenCalled()
expect(@restMock.GET).toHaveBeenCalledWith "#{o.path}?limit=10", jasmine.any(Function)

Expand Down

0 comments on commit f2d7394

Please sign in to comment.