Minitest Helper Tests
Learn how to write tests for Minitest helper testing.
We'll cover the following...
We'll cover the following...
Minitest helper methods
Rails provides the ActionView::TestCase class, a subclass of ActiveSupport::TestCase designed to load enough of the Rails controller structure to enable helpers to be called and tested. Let’s look at the Minitest version of the name_with_status helper tests:
rsync -avr --progress /usercode/* /usr/local/educative/gatherer --exclude course-content --exclude execute1.sh --exclude execute.sh --exclude __ed_script.sh --exclude __ed_stderr.txt --exclude __ed_stdout.txt cd /usr/local/educative/gatherer clear bundle exec rake test
Adding code to project_helper_test.rb file in test/helpers directory
The assert_dom_equal method doesn’t have an RSpec equivalent. We use assert_dom_equal to compare the string we expect to the string we get from the helper. The assert_dom_equal assertion checks that two strings resolve to equivalent DOM structures. It tests ...