mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-12 23:27:48 +00:00
Tweaking spec names
This commit is contained in:
committed by
Rohan Mitchell
parent
1f6641766d
commit
74f29f8c74
@@ -6,19 +6,19 @@ describe Enterprise do
|
||||
let(:enterprise) { create(:distributor_enterprise, updated_at: 1.week.ago) }
|
||||
let(:taxon) { create(:taxon) }
|
||||
|
||||
describe "with supplied taxon" do
|
||||
describe "with a supplied product" do
|
||||
let(:product) { create(:simple_product, supplier: enterprise) }
|
||||
let!(:classification) { create(:classification, taxon: taxon, product: product) }
|
||||
it "supplied taxon is updated" do
|
||||
it "touches enterprise when a classification on that product changes" do
|
||||
expect{classification.save!}.to change{enterprise.updated_at}
|
||||
end
|
||||
end
|
||||
|
||||
describe "with distributed taxon" do
|
||||
describe "with a distributed product" do
|
||||
let(:product) { create(:simple_product) }
|
||||
let!(:oc) { create(:simple_order_cycle, distributors: [enterprise], variants: [product.master]) }
|
||||
let!(:classification) { create(:classification, taxon: taxon, product: product) }
|
||||
it "distributed taxon is updated" do
|
||||
it "touches enterprise when a classification on that product changes" do
|
||||
expect{classification.save!}.to change{enterprise.reload.updated_at}
|
||||
end
|
||||
end
|
||||
@@ -26,7 +26,7 @@ describe Enterprise do
|
||||
describe "with relatives" do
|
||||
let(:child_enterprise) { create(:supplier_enterprise) }
|
||||
let!(:er) { create(:enterprise_relationship, parent: enterprise, child: child_enterprise) }
|
||||
it "enterprise relationship is updated" do
|
||||
it "touches enterprise when enterprise relationship is updated" do
|
||||
expect{er.save!}.to change {enterprise.reload.updated_at }
|
||||
end
|
||||
end
|
||||
@@ -36,13 +36,13 @@ describe Enterprise do
|
||||
before do
|
||||
enterprise.shipping_methods << sm
|
||||
end
|
||||
it "distributor_shipping_method is updated" do
|
||||
it "touches enterprise when distributor_shipping_method is updated" do
|
||||
expect {
|
||||
enterprise.distributor_shipping_methods.first.save!
|
||||
}.to change {enterprise.reload.updated_at}
|
||||
end
|
||||
|
||||
it "shipping method is updated" do
|
||||
it "touches enterprise when shipping method is updated" do
|
||||
expect{sm.save!}.to change {enterprise.reload.updated_at }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user