I want to be sure my page does not contain certain text, I know there is an assert_text function, but, how do I test the opposite?
I am using RoR 6.0, the default test framework (I think it is Test Unit) and capybara
I want to be sure my page does not contain certain text, I know there is an assert_text function, but, how do I test the opposite?
I am using RoR 6.0, the default test framework (I think it is Test Unit) and capybara
Copyright © 2021 Jogjafile Inc.
Rails 6 is using Minitest and Capybara by default.
assert_textcomes from Capybara, or to be more precise, fromCapybara::Minitest::Assertions.As you can see in
Capybara::Minitest::Assertions, there is an assertion calledassert_no_text, which, I suppose, does exactly what you need.Further details can be found here.
And this is a link to a quick explanation of the difference between
Test::UnitandMinitest.Hope this helps.