mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-18 00:17:25 +00:00
23 lines
745 B
Ruby
23 lines
745 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
describe SearchOrders do
|
|
let!(:distributor) { create(:distributor_enterprise) }
|
|
let!(:order1) { create(:order_with_line_items, distributor: distributor, line_items_count: 3) }
|
|
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(:enterprise_user) { distributor.owner }
|
|
|
|
describe '#orders' do
|
|
let(:params) { {} }
|
|
let(:service) { SearchOrders.new(params, enterprise_user) }
|
|
|
|
it 'returns orders' do
|
|
expect(service.orders.count).to eq 3
|
|
end
|
|
end
|
|
end
|