Fix some more code climate violations for bulk coop specs which have been moved to the order management engine.

This commit is contained in:
Cillian O'Ruanaidh
2020-06-13 16:23:11 +01:00
parent fdf0d92366
commit 0ef3a7e24f
3 changed files with 20 additions and 7 deletions

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "spec_helper"
describe OrderManagement::Reports::BulkCoopController, type: :controller do

View File

@@ -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

View File

@@ -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