tap/test/integration/product_attributes_test.rb
2015-03-04 19:59:07 +01:00

20 lines
414 B
Ruby

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