0

This is the code in my test:

assert_select "a[href=?]", "/path/with?params", { :count => 1, :text => "" }

And this is the failure message I get:

Expected exactly 1 element matching "a[href='/path/with?params']", found 0..
Expected: 0
Actual: 1

Any clues what's happening here? Is it expecting 0 or 1 and is it finding 1 or 0?

UPDATE: For everyone coming here searching how to do what I was trying to do, I ended up doing this:

assert_match(/<a href="/path/with?params">/, response.body)

sebkkom
  • 1,426
  • 17
  • 31

1 Answers1

1

Yes, this is a known problem.

https://github.com/rails/rails/issues/14422

https://github.com/rails/rails/pull/14450

SteveTurczyn
  • 36,057
  • 6
  • 41
  • 53