mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Fix some more code climate violations for bulk coop specs which have been moved to the order management engine.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "spec_helper"
|
||||
|
||||
describe OrderManagement::Reports::BulkCoopController, type: :controller do
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "spec_helper"
|
||||
|
||||
feature "bulk coop" do
|
||||
@@ -13,5 +15,3 @@ feature "bulk coop" do
|
||||
expect(page).to have_content 'Supplier'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -39,12 +39,18 @@ describe OrderManagement::Reports::BulkCoop::BulkCoopReport do
|
||||
end
|
||||
|
||||
context "that has granted P-OC to the distributor" do
|
||||
let(:o2) { create(:order, distributor: d1, completed_at: 1.day.ago, bill_address: create(:address), ship_address: create(:address)) }
|
||||
let(:li2) { build(:line_item_with_shipment, product: create(:simple_product, supplier: s1)) }
|
||||
let(:o2) do
|
||||
create(:order, distributor: d1, completed_at: 1.day.ago, bill_address: create(:address),
|
||||
ship_address: create(:address))
|
||||
end
|
||||
let(:li2) do
|
||||
build(:line_item_with_shipment, product: create(:simple_product, supplier: s1))
|
||||
end
|
||||
|
||||
before do
|
||||
o2.line_items << li2
|
||||
create(:enterprise_relationship, parent: s1, child: d1, permissions_list: [:add_to_order_cycle])
|
||||
create(:enterprise_relationship, parent: s1, child: d1,
|
||||
permissions_list: [:add_to_order_cycle])
|
||||
end
|
||||
|
||||
it "shows line items supplied by my producers, with names hidden" do
|
||||
@@ -54,8 +60,13 @@ describe OrderManagement::Reports::BulkCoop::BulkCoopReport do
|
||||
end
|
||||
|
||||
context "that has not granted P-OC to the distributor" do
|
||||
let(:o2) { create(:order, distributor: d1, completed_at: 1.day.ago, bill_address: create(:address), ship_address: create(:address)) }
|
||||
let(:li2) { build(:line_item_with_shipment, product: create(:simple_product, supplier: s1)) }
|
||||
let(:o2) do
|
||||
create(:order, distributor: d1, completed_at: 1.day.ago, bill_address: create(:address),
|
||||
ship_address: create(:address))
|
||||
end
|
||||
let(:li2) do
|
||||
build(:line_item_with_shipment, product: create(:simple_product, supplier: s1))
|
||||
end
|
||||
|
||||
before do
|
||||
o2.line_items << li2
|
||||
|
||||
Reference in New Issue
Block a user