mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-20 04:59:16 +00:00
fix orders controllers specs errors
This commit is contained in:
@@ -15,7 +15,7 @@ module Api
|
||||
orders = search_results.orders
|
||||
|
||||
render json: {
|
||||
orders: orders,
|
||||
orders: serialized_orders(orders),
|
||||
pagination: pagination_required? ? pagination_data(orders) : nil
|
||||
}
|
||||
end
|
||||
|
||||
@@ -18,20 +18,4 @@ describe SearchOrders do
|
||||
expect(service.orders.count).to eq 3
|
||||
end
|
||||
end
|
||||
|
||||
describe '#pagination_data' do
|
||||
let(:params) { { per_page: 15, page: 1 } }
|
||||
let(:service) { SearchOrders.new(params, enterprise_user) }
|
||||
|
||||
it 'returns pagination data' do
|
||||
pagination_data = {
|
||||
results: 3,
|
||||
pages: 1,
|
||||
page: 1,
|
||||
per_page: 15
|
||||
}
|
||||
|
||||
expect(service.pagination_data).to eq pagination_data
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user