From 1f012dc52ca447c2e1ce69c19bcf0b1fbb3e0d1e Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 18 Dec 2013 16:15:23 +1100 Subject: [PATCH] Patching up the tests to check on our serialisers --- app/serializers/order_cycle_serializer.rb | 3 +++ spec/controllers/shop_controller_spec.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 app/serializers/order_cycle_serializer.rb diff --git a/app/serializers/order_cycle_serializer.rb b/app/serializers/order_cycle_serializer.rb new file mode 100644 index 0000000000..202e7ba0d3 --- /dev/null +++ b/app/serializers/order_cycle_serializer.rb @@ -0,0 +1,3 @@ +class OrderCycleSerializer < ActiveModel::Serializer + attributes :orders_close_at +end diff --git a/spec/controllers/shop_controller_spec.rb b/spec/controllers/shop_controller_spec.rb index a3d7997479..8f355c259b 100644 --- a/spec/controllers/shop_controller_spec.rb +++ b/spec/controllers/shop_controller_spec.rb @@ -81,7 +81,7 @@ describe ShopController do it "only returns products for the current order cycle" do controller.stub(:current_order_cycle).and_return order_cycle xhr :get, :products - response.body.should == [product].to_json + response.body.should == [Spree::ProductSerializer.new(product)].to_json end end end