rails/rails-dom-testing

Assert absence does not work properly on selectors containing '?'

khustochka opened this issue · 2 comments

I have added the following assertion:

assert_nothing_raised { assert_select "a[href='http://example.org?query=value']", false }

It raises exception:

Expected at least 1 element matching "a[href='http://example.orgfalsequery=value']", found 0..
Expected 0 to be >= 1.

As you can see the problem is that ? is substituted by false, and assertion checks for presence, not absence.

Thanks for reporting this. I've opened #11 to work on this.

This should be fixed now. We're aren't making a new release just yet, so you'll have to add gem 'rails-dom-testing', github: 'rails/rails-dom-testing' in your Gemfile for now.

Thanks again.