Open
Description
Given a page like so:
<h1>Users</h1>
<table>
...
</table>
Total: <span class="total">4781</span>
It's pretty reasonable to write something like this:
get "/users"
assert_select "h1", "Users"
assert_select ".total", User.count
However, that would give you a very confusing error:
Failure:
MyApp::UsersTest#test_index:
Expected exactly 4781 elements matching ".total", found 1..
Expected: 4781
Actual: 1
Given that we already support assert_select ".total", count: User.count
, I think we should consider deprecating the numeric positional argument overload (as shown in the example) in favor of the explicit keyword argument, and potentially reclaiming the space for automatic to_s
-ing the positional argument in the future (to make the example "just work").
Metadata
Metadata
Assignees
Labels
No labels