Final test

This commit is contained in:
benji 2015-03-04 19:59:07 +01:00
parent 41e8c113ed
commit 88c780b14e

View file

@ -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