I am new in Ruby on Rails and I'm a bit confuse right now. I run a rake
test and there was an error:
wrong argument number (1 of 0)
Can somebody help me? How can I correct the argument number? See below for my code.
test 'product price must be positive' do
product = Product.new(title: "My Book Title",
description: "yyy",
image_url: "zzz.jpg" )
product.price = -1
assert product.invalid?
assert_equal ['must be greater than or equal to 0.01'],
product.errors[:price]
product.price = 0
assert product.invalid?
assert_equal ['must be greater than or equal to 0.01'],
product.errors[:price]
product.price = 1
assert product.valid?