From f8b54cfb0bc93fabf8ef188ddb9c73426764963b Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Tue, 12 Dec 2017 13:19:03 -0800 Subject: [PATCH] Use kaminari's current_per_page This is cleaner than checking limit_value --- api/app/views/spree/api/shared/_pagination.json.jbuilder | 2 +- backend/spec/controllers/spree/admin/orders_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/app/views/spree/api/shared/_pagination.json.jbuilder b/api/app/views/spree/api/shared/_pagination.json.jbuilder index 153b3abb93e..f30f706ae5a 100644 --- a/api/app/views/spree/api/shared/_pagination.json.jbuilder +++ b/api/app/views/spree/api/shared/_pagination.json.jbuilder @@ -2,4 +2,4 @@ json.count pagination.count json.total_count pagination.total_count json.current_page pagination.current_page json.pages pagination.total_pages -json.per_page pagination.limit_value +json.per_page pagination.current_per_page diff --git a/backend/spec/controllers/spree/admin/orders_controller_spec.rb b/backend/spec/controllers/spree/admin/orders_controller_spec.rb index 4ef7b69d503..6e6964ce2fb 100644 --- a/backend/spec/controllers/spree/admin/orders_controller_spec.rb +++ b/backend/spec/controllers/spree/admin/orders_controller_spec.rb @@ -68,7 +68,7 @@ it "can page through the orders" do get :index, params: { page: 2, per_page: 10 } expect(assigns[:orders].offset_value).to eq(10) - expect(assigns[:orders].limit_value).to eq(10) + expect(assigns[:orders].current_per_page).to eq(10) end end