Fetch orders sorted by completion date

This commit is contained in:
Pau Perez
2018-11-15 14:26:49 +01:00
parent e69d297f86
commit b1b04b505e
2 changed files with 8 additions and 1 deletions

View File

@@ -30,6 +30,13 @@ describe "ordersCtrl", ->
expect(Orders.index).toHaveBeenCalled()
expect($scope.orders).toEqual orders
it "fetches them sorted by completed_at by default", ->
$scope.initialise()
expect(Orders.index).toHaveBeenCalledWith(jasmine.objectContaining({
'q[s]': 'completed_at desc'
}))
describe "using pagination", ->
it "changes the page", ->
$scope.changePage(2)