From 5e040327972191ded077b4e9e04418fc2f1dca6c Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Mon, 23 Jul 2012 18:48:30 +1000 Subject: [PATCH] Explicitly specify Spree 1.1.1, fix test regression in OrdersController --- Gemfile | 2 +- Gemfile.lock | 2 +- spec/controllers/orders_controller_spec.rb | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 3231e1f5fa..c5b88954b6 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ ruby "1.9.3" gem 'rails', '3.2.3' gem 'pg' -gem 'spree' +gem 'spree', '1.1.1' gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git' gem 'spree_paypal_express', :git => 'git://github.com/spree/spree_paypal_express.git' gem 'spree_last_address', :git => 'git://github.com/dancinglightning/spree-last-address.git' diff --git a/Gemfile.lock b/Gemfile.lock index 46a7518cc3..435770fdbe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -340,7 +340,7 @@ DEPENDENCIES shoulda-matchers simple_form! spork (~> 1.0rc) - spree + spree (= 1.1.1) spree_heroku! spree_i18n! spree_last_address! diff --git a/spec/controllers/orders_controller_spec.rb b/spec/controllers/orders_controller_spec.rb index 6204cbcc60..a041d57424 100644 --- a/spec/controllers/orders_controller_spec.rb +++ b/spec/controllers/orders_controller_spec.rb @@ -15,7 +15,7 @@ describe Spree::OrdersController do p = create(:product) expect do - spree_put :populate, :variants => {p.id => 1} + spree_post :populate, :variants => {p.master.id => 1} end.to change(Spree::LineItem, :count).by(0) end @@ -25,7 +25,7 @@ describe Spree::OrdersController do p = create(:product, :distributors => [distributor_product]) expect do - spree_put :populate, :variants => {p.id => 1}, :distributor_id => distributor_no_product.id + spree_post :populate, :variants => {p.master.id => 1}, :distributor_id => distributor_no_product.id end.to change(Spree::LineItem, :count).by(0) end @@ -39,7 +39,7 @@ describe Spree::OrdersController do order.save! expect do - spree_put :populate, :variants => {p.id => 1}, :distributor_id => distributor_product.id + spree_post :populate, :variants => {p.master.id => 1}, :distributor_id => distributor_product.id end.to change(Spree::LineItem, :count).by(1) order.reload.distributor.should == distributor_product @@ -51,7 +51,7 @@ describe Spree::OrdersController do p = create(:product, :distributors => [d]) # When we add the product to our cart - spree_put :populate, :variants => {p.id => 1}, :distributor_id => d.id + spree_post :populate, :variants => {p.master.id => 1}, :distributor_id => d.id # Then our order should have its distributor set to the chosen distributor current_order(false).distributor.should == d @@ -65,7 +65,7 @@ describe Spree::OrdersController do @product = create(:product, :distributors => [@distributor]) # And the product is in the cart - spree_put :populate, :variants => {@product.id => 1}, :distributor_id => @distributor.id + spree_post :populate, :variants => {@product.master.id => 1}, :distributor_id => @distributor.id current_order(false).line_items.reload.map { |li| li.product }.should == [@product] current_order(false).distributor.reload.should == @distributor end @@ -76,7 +76,7 @@ describe Spree::OrdersController do p2 = create(:product, :distributors => [d2]) # When I attempt to add the product to the cart - spree_put :populate, :variants => {p2.id => 1}, :distributor_id => d2.id + spree_post :populate, :variants => {p2.master.id => 1}, :distributor_id => d2.id # Then the product should not be added to the cart current_order(false).line_items.reload.map { |li| li.product }.should == [@product] @@ -89,7 +89,7 @@ describe Spree::OrdersController do p2 = create(:product, :distributors => [d2]) # When I attempt to add the product to the cart with a fake distributor_id - spree_put :populate, :variants => {p2.id => 1}, :distributor_id => @distributor.id + spree_post :populate, :variants => {p2.master.id => 1}, :distributor_id => @distributor.id # Then the product should not be added to the cart current_order(false).line_items.reload.map { |li| li.product }.should == [@product] @@ -102,7 +102,7 @@ describe Spree::OrdersController do p2 = create(:product, :distributors => [@distributor, d2]) # When I attempt to add the product to the cart with the alternate distributor - spree_put :populate, :variants => {p2.id => 1}, :distributor_id => d2 + spree_post :populate, :variants => {p2.master.id => 1}, :distributor_id => d2 # Then the product should not be added to the cart current_order(false).line_items.reload.map { |li| li.product }.should == [@product]