From 1e94f88c5e5a7e2251ea098ef484b7358c06be30 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 7 Jun 2013 15:40:03 +1000 Subject: [PATCH 1/2] Ensure order decorator is required, fix test fragility --- app/controllers/spree/orders_controller_decorator.rb | 2 ++ spec/lib/open_food_web/order_cycle_form_applicator_spec.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/spree/orders_controller_decorator.rb b/app/controllers/spree/orders_controller_decorator.rb index 730d96b279..49612546b4 100644 --- a/app/controllers/spree/orders_controller_decorator.rb +++ b/app/controllers/spree/orders_controller_decorator.rb @@ -1,3 +1,5 @@ +require 'spree/core/controller_helpers/order_decorator' + Spree::OrdersController.class_eval do before_filter :populate_order_distributor, :only => :populate before_filter :populate_order_count_on_hand, :only => :populate diff --git a/spec/lib/open_food_web/order_cycle_form_applicator_spec.rb b/spec/lib/open_food_web/order_cycle_form_applicator_spec.rb index 4ebf51e9ba..18b64986bf 100644 --- a/spec/lib/open_food_web/order_cycle_form_applicator_spec.rb +++ b/spec/lib/open_food_web/order_cycle_form_applicator_spec.rb @@ -160,7 +160,7 @@ module OpenFoodWeb applicator.send(:update_exchange, sender.id, receiver.id, {:variant_ids => [variant1.id, variant3.id]}) exchange.reload - exchange.variant_ids.should == [variant1.id, variant3.id] + exchange.variant_ids.sort.should == [variant1.id, variant3.id].sort applicator.send(:touched_exchanges).should == [exchange] end end From 26c3b80e87d5aace83c75ccd96654c9335167593 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 14 Jun 2013 11:05:56 +1000 Subject: [PATCH 2/2] Reverse unintentional changes to database.yml and db/schema.rb --- config/database.yml | 7 +------ db/schema.rb | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/config/database.yml b/config/database.yml index 40ffe445f7..9633824f0f 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,12 +1,8 @@ development: adapter: postgresql encoding: unicode - #template: template0 - #collate: en_US.UTF8 - #ctype: en_US.UTF8 database: open_food_web_dev pool: 5 - host: localhost username: ofw password: f00d @@ -15,7 +11,6 @@ test: encoding: unicode database: open_food_web_test pool: 5 - host: localhost username: ofw password: f00d @@ -26,4 +21,4 @@ production: database: open_food_web_prod pool: 5 username: ofw - password: f00d + password: f00d \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index b99bd0a260..a35dd39545 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -422,7 +422,6 @@ ActiveRecord::Schema.define(:version => 20130207043555) do t.string "email" t.text "special_instructions" t.integer "distributor_id" - t.integer "order_cycle_id" t.string "currency" t.string "last_ip_address" end