From 88c780b14e3eefa3d59bde1dae0f2f0c66d7afd2 Mon Sep 17 00:00:00 2001 From: benji Date: Wed, 4 Mar 2015 19:59:07 +0100 Subject: [PATCH] Final test --- test/integration/product_attributes_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/integration/product_attributes_test.rb diff --git a/test/integration/product_attributes_test.rb b/test/integration/product_attributes_test.rb new file mode 100644 index 0000000..ec7ccfa --- /dev/null +++ b/test/integration/product_attributes_test.rb @@ -0,0 +1,20 @@ +require 'test_helper' + +class ProductAttributesTest < ActiveSupport::TestCase + test "product_attributes are read correctly" do + params = { + order_items_attributes: [ + { + count: "5", + product_attributes: { + id: products(:fanta).id + } + } + ] + } + + o = Order.create(params) + + assert_equal o.order_items.first.product, products(:fanta) + end +end