In my page, I have a link like this:
<input value="" data-autofocus="true" class="form-control"
type="text" name="user[login]" id="user_login" />
Using Capybara with Minitest, driver :rack_test, the following selector finds the input, but the parallel assertion gets an error [edited to include the trace]:
(ruby) has_field?("user_login")
true
(ruby) assert_field("user_login")
eval error: Unused parameters passed to Capybara::Queries::SelectorQuery : [:field, "user_login"]
/home/vagrant/.rvm/gems/ruby-3.0.4/gems/capybara-3.37.1/lib/capybara/queries/selector_query.rb:52:in `initialize'
/home/vagrant/.rvm/gems/ruby-3.0.4/gems/capybara-3.37.1/lib/capybara/node/matchers.rb:842:in `new'
/home/vagrant/.rvm/gems/ruby-3.0.4/gems/capybara-3.37.1/lib/capybara/node/matchers.rb:842:in `_verify_selector_result'
/home/vagrant/.rvm/gems/ruby-3.0.4/gems/capybara-3.37.1/lib/capybara/node/matchers.rb:110:in `assert_selector'
/home/vagrant/.rvm/gems/ruby-3.0.4/gems/capybara-3.37.1/lib/capybara/session.rb:771:in `assert_selector'
/home/vagrant/.rvm/gems/ruby-3.0.4/gems/capybara-3.37.1/lib/capybara/dsl.rb:52:in `call'
/home/vagrant/.rvm/gems/ruby-3.0.4/gems/capybara-3.37.1/lib/capybara/dsl.rb:52:in `assert_selector'
/home/vagrant/.rvm/gems/ruby-3.0.4/gems/capybara-3.37.1/lib/capybara/minitest.rb:288:in `block (2 levels) in <module:Assertions>'
(rdbg)//vagrant/mo/test/integration/capybara_student_test.rb:1:in `block in test_creating_drafts'
nil
The rubydocs for Capybara::Minitest::Assertions#assert_field say that the method is built straight off Node::Matchers#has_field?. I wonder why it isn't working?
EDIT: Belatedly realizing this is probably relevant... I'm including Capybara::Minitest::Assertions in the tests, and using Sean P. Doyle's gem ActionDispatch::Testing::Integration::Capybara to use Capybara in integration tests.