Ruby on rails Rails测试错误---预期为+++;实际的

Ruby on rails Rails测试错误---预期为+++;实际的,ruby-on-rails,ruby,unit-testing,Ruby On Rails,Ruby,Unit Testing,下面是我收到的错误消息: Failure: ProductTest#test_product_price_must_be_positive [/home/jatin/work/depot/test/models/product_test.rb:18]: --- expected +++ actual @@ -1 +1 @@ -["must be geater than or equal to 0.01"] +["must be greater than or equal to 0.01"] 这

下面是我收到的错误消息:

Failure:
ProductTest#test_product_price_must_be_positive [/home/jatin/work/depot/test/models/product_test.rb:18]:
--- expected
+++ actual
@@ -1 +1 @@
-["must be geater than or equal to 0.01"]
+["must be greater than or equal to 0.01"]
这是测试代码:

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 geater 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?
end
这是app/models/product.rb文件中的代码:

class Product < ApplicationRecord
validates :title, :description, :image_url, presence: true
validates :price, numericality: {greater_than_or_equal_to: 0.01}
validates :title, uniqueness: true
validates :image_url, allow_blank: true, format: {
    with: %r{\.(gif|jpg|png)\Z}i,
    message: 'must be a URL for GIF, JPG or PNG image.'
}
end
类产品
请建议解决此问题的方法。

您有输入错误:

assert_equal ["must be geater than or equal to 0.01"], 
#                       ^ here
# Change to :
assert_equal ["must be greater than or equal to 0.01"],

你看过考试失败的情况吗?你比较了这两个字符串吗?