mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update test to add more case with finalized order with no line items
Those empty order but finalized must be returned by the API
This commit is contained in:
@@ -8,6 +8,8 @@ describe SearchOrders do
|
||||
let!(:order2) { create(:order_with_line_items, distributor: distributor, line_items_count: 2) }
|
||||
let!(:order3) { create(:order_with_line_items, distributor: distributor, line_items_count: 1) }
|
||||
let!(:order_empty) { create(:order, distributor: distributor) }
|
||||
let!(:order_empty_but_complete) { create(:order, distributor: distributor, state: :complete) }
|
||||
let!(:order_empty_but_canceled) { create(:order, distributor: distributor, state: :canceled) }
|
||||
|
||||
let(:enterprise_user) { distributor.owner }
|
||||
|
||||
@@ -16,7 +18,10 @@ describe SearchOrders do
|
||||
let(:service) { SearchOrders.new(params, enterprise_user) }
|
||||
|
||||
it 'returns orders' do
|
||||
expect(service.orders.count).to eq 3
|
||||
expect(service.orders.count).to eq 5
|
||||
service.orders.each do |order|
|
||||
expect(order.id).not_to eq(order_empty.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user