【发布时间】:2016-09-02 14:39:05
【问题描述】:
我的测试失败了:
assert_match @post.user_id, @user.id
出现奇怪的错误:
Expected 762146111 to match 762146111.
我尝试在创建和/或匹配步骤中使用 with and w/o Integer()
【问题讨论】:
-
为什么不
assert_equal?assert_match期望第一个参数是使用=~的正则表达式。例如123 == 123 #=> true但123 =~ 123 #=> nil。 BTWnil响应来自Object实现 Docs
标签: ruby-on-rails ruby testing rake-test