class ActionView::TestCase
Public Class Methods
Resolve the helper or view from the test name when using the spec DSL
# File lib/minitest/rails.rb, line 60 def self.determine_default_helper_class(name) determine_constant_from_test_name(name) do |constant| Module === constant && !(Class === constant) end end
Public Instance Methods
Checks if an expression is blank. Passes if actual.blank? is true.
This assertion is deprecated.¶ ↑
Use the following to check for blank?
instead:
assert actual.blank?
The deprecated assertion can be called like this:
assert_blank []
See also MiniTest::Rails::Expectations#must_be_blank
# File lib/minitest/rails/assertions.rb, line 624
Checks the numeric difference between the return value of an expression as a result of what is evaluated.
assert_difference "User.count", +1 do User.create end
See also MiniTest::Rails::Expectations#must_change
# File lib/minitest/rails/assertions.rb, line 690
Checks that the numeric result of evaluating an expression is not changed before and after invoking.
assert_no_difference "User.count" do User.new end
See also MiniTest::Rails::Expectations#wont_change
# File lib/minitest/rails/assertions.rb, line 702
Checks if an expression is present. Passes if actual.present? is true.
This assertion is deprecated.¶ ↑
Use the following to check for present?
instead:
assert actual.present?
The deprecated assertion can be called like this:
assert_present Object.new
See also MiniTest::Rails::Expectations#must_be_present
# File lib/minitest/rails/assertions.rb, line 660
Checks if an expression is not blank. Passes if actual.blank? is false.
This assertion is deprecated.¶ ↑
Use the following to check for blank?
instead:
refute actual.blank?
The deprecated assertion can be called like this:
refute_blank [1,2,3]
See also MiniTest::Rails::Expectations#wont_be_blank
:args: actual, message = nil
Checks that the numeric result of evaluating an expression is not changed before and after invoking.
refute_difference "User.count", do User.new end
See also MiniTest::Rails::Expectations#wont_change
:args: expression, message = nil, &block
Checks if an expression is not present. Passes if actual.present? is false.
This assertion is deprecated.¶ ↑
Use the following to check for present?
instead:
refute actual.present?
The deprecated assertion can be called like this:
refute_present nil
See also MiniTest::Rails::Expectations#wont_be_present
:args: actual, message = nil