I am new to testing, so feel free to correct me if I am mistaken in my approach to this.
I am testing a Rails4 application using Minitest. Since I have JS included in many pages, I use Capybara to use JS drivers in my tests, as well as to trigger JS events and verify the expected results. This is where my confusion begins, as there are many ways to enable Capybara.
In addition, I found out that the “normal” statement style syntax will not work with Capybara. And here are my confusions. During my research, I found that there is a Spec DS for Capybara, and a few more. Now I am using the minitest-rails-capybara ( Github ) gem , and I tried working with the / DSL methods on this list: RubyDoc
I tried to replace the simple statement that tests for an HTML element.
before: assert_select "title", "Study | Word Up"
Now: page.has_selector?('title', :text => "Study | Word Up")
But no matter what I test, the test always passes. How is this possible? I checked the server logs to see if I am on the correct page. But everything seems beautiful, passing the test does not make sense.