diff --git a/spec/controllers/enterprises_controller_spec.rb b/spec/controllers/enterprises_controller_spec.rb index 93782ff21a..45d0374a84 100644 --- a/spec/controllers/enterprises_controller_spec.rb +++ b/spec/controllers/enterprises_controller_spec.rb @@ -1,11 +1,6 @@ require 'spec_helper' describe EnterprisesController do - before :each do - stub!(:before_save_new_order) - stub!(:after_save_new_order) - end - it "displays suppliers" do s = create(:supplier_enterprise) d = create(:distributor_enterprise) diff --git a/spec/helpers/products_helper_spec.rb b/spec/helpers/products_helper_spec.rb index a6e16bab55..040fad5db3 100644 --- a/spec/helpers/products_helper_spec.rb +++ b/spec/helpers/products_helper_spec.rb @@ -22,13 +22,8 @@ module Spree private def make_variant_stub(product_price, variant_price) - product = stub(:product) - product.stub(:price).and_return(product_price) - - variant = stub(:variant) - variant.stub(:product).and_return(product) - variant.stub(:price).and_return(variant_price) - + product = double(:product, price: product_price) + variant = double(:variant, product: product, price: variant_price) variant end end diff --git a/spec/lib/open_food_web/split_products_by_distribution_spec.rb b/spec/lib/open_food_web/split_products_by_distribution_spec.rb index afba1ebb9d..678f94c327 100644 --- a/spec/lib/open_food_web/split_products_by_distribution_spec.rb +++ b/spec/lib/open_food_web/split_products_by_distribution_spec.rb @@ -66,15 +66,8 @@ describe OpenFoodWeb::SplitProductsByDistribution do def build_product(distributor, in_distributor, order_cycle, in_order_cycle) product = double(:product) - if distributor - product.should_receive(:in_distributor?).any_number_of_times. - with(distributor).and_return(in_distributor) - end - - if order_cycle - product.should_receive(:in_order_cycle?).any_number_of_times. - with(order_cycle).and_return(in_order_cycle) - end + product.stub(:in_distributor?) { in_distributor } if distributor + product.stub(:in_order_cycle?) { in_order_cycle } if order_cycle product end