0

My test fail on:

assert_match @post.user_id, @user.id

with strange error:

Expected 762146111 to match 762146111.

I have tried to use with and w/o Integer() in creation and/or on match steps

ChaosPredictor
  • 3,777
  • 1
  • 36
  • 46
  • 2
    why not `assert_equal`? `assert_match` is expecting the first argument to be a regex using `=~`. e.g. `123 == 123 #=> true` but `123 =~ 123 #=> nil`. BTW `nil` response comes from the `Object` implementation [Docs](https://ruby-doc.org/core-2.2.0/Object.html#method-i-3D-7E) – engineersmnky Sep 02 '16 at 14:49

1 Answers1

1

Thanks to engineersmnky.

It should be:

assert_equal @post.user_id, @user.id
Community
  • 1
  • 1
ChaosPredictor
  • 3,777
  • 1
  • 36
  • 46