jeudi 3 mars 2016

assert_difference with a String?

Here's a standard insert_difference update test:

assert_difference 'Article.count' do
  post :create, article: {...}
end

Is it possible to do something equivalent to insert_difference when a String is being tested?

assert_difference 'Article.name' do
  post :create, article: {...}
end
# TypeError: no implicit conversion of Fixnum into String 

Aucun commentaire:

Enregistrer un commentaire