Rails testing: assert_invalid_column_on_record is deprecated

I had:

assert_invalid_column_on_record “user”, “password”

I tried replacing it with assert(record.errors.invalid?(column)) as the deprecation warning advised, but it did not work.
What did work was:

assert !user.valid?
assert user.errors.on(:password)

  • Johnny
    This is an old article. But great. Keep up the good work.
blog comments powered by Disqus