Final test
This commit is contained in:
parent
41e8c113ed
commit
88c780b14e
1 changed files with 20 additions and 0 deletions
20
test/integration/product_attributes_test.rb
Normal file
20
test/integration/product_attributes_test.rb
Normal 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
|
Loading…
Reference in a new issue