mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Fix fragile specs (ordering)
This commit is contained in:
@@ -173,12 +173,12 @@ describe Spree::Admin::ReportsController do
|
||||
|
||||
it "builds suppliers for the current user" do
|
||||
spree_get :products_and_inventory
|
||||
assigns(:suppliers).should == [s1, s2, s3]
|
||||
assigns(:suppliers).sort.should == [s1, s2, s3].sort
|
||||
end
|
||||
|
||||
it "builds order cycles for the current user" do
|
||||
spree_get :products_and_inventory
|
||||
assigns(:order_cycles).should == [ocB, ocA]
|
||||
assigns(:order_cycles).sort.should == [ocB, ocA].sort
|
||||
end
|
||||
|
||||
it "assigns report types" do
|
||||
@@ -216,7 +216,7 @@ describe Spree::Admin::ReportsController do
|
||||
|
||||
it "should build distributors for the current user" do
|
||||
spree_get :customers
|
||||
assigns(:distributors).should == [d1, d2, d3]
|
||||
assigns(:distributors).sort.should == [d1, d2, d3].sort
|
||||
end
|
||||
|
||||
it "builds suppliers for the current user" do
|
||||
@@ -226,7 +226,7 @@ describe Spree::Admin::ReportsController do
|
||||
|
||||
it "builds order cycles for the current user" do
|
||||
spree_get :customers
|
||||
assigns(:order_cycles).should == [ocB, ocA]
|
||||
assigns(:order_cycles).sort.should == [ocB, ocA].sort
|
||||
end
|
||||
|
||||
it "assigns report types" do
|
||||
|
||||
@@ -42,8 +42,8 @@ feature %q{
|
||||
click_button 'Update'
|
||||
|
||||
product.reload
|
||||
product.distributors.should == [@distributors[0], @distributors[2]]
|
||||
product.product_distributions.map { |pd| pd.enterprise_fee }.should == [@enterprise_fees[0], @enterprise_fees[2]]
|
||||
product.distributors.sort.should == [@distributors[0], @distributors[2]].sort
|
||||
product.product_distributions.map { |pd| pd.enterprise_fee }.sort.should == [@enterprise_fees[0], @enterprise_fees[2]].sort
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ module OpenFoodNetwork
|
||||
it "should return unfiltered variants sans-params" do
|
||||
product1 = create(:simple_product, supplier: supplier)
|
||||
product2 = create(:simple_product, supplier: supplier)
|
||||
subject.filter(Spree::Variant.scoped).should == [product1.master, product2.master]
|
||||
subject.filter(Spree::Variant.scoped).sort.should == [product1.master, product2.master].sort
|
||||
end
|
||||
describe "based on report type" do
|
||||
it "returns only variants on hand" do
|
||||
|
||||
@@ -16,7 +16,7 @@ module Spree
|
||||
end
|
||||
|
||||
it "returns variants in stock or on demand, but not those that are neither" do
|
||||
Variant.where(is_master: false).in_stock.should == [@v_in_stock, @v_on_demand]
|
||||
Variant.where(is_master: false).in_stock.sort.should == [@v_in_stock, @v_on_demand].sort
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user