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.