assert_no_difference

assert_no_difference(expression, message = nil, &block)
Instance Public methods

Assertion that the numeric result of evaluating an expression is not changed before and after invoking the passed in block.

assert_no_difference 'Article.count' do
  post :create, article: invalid_attributes
end

An error message can be specified.

assert_no_difference 'Article.count', 'An Article should not be created' do
  post :create, article: invalid_attributes
end
doc_ruby_on_rails
2015-06-20 00:00:00
Comments
Leave a Comment

Please login to continue.