Class: Dommy::RSpec::CapyStyleMatchers::HaveField Private
- Defined in:
- lib/dommy/rspec/capy_style_matchers.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
have_field locates form fields by name attribute, id, or label text.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(name_or_label, **opts) ⇒ HaveField
constructor
private
A new instance of HaveField.
Methods inherited from Base
#description, #does_not_match?, #failure_message, #failure_message_when_negated, #matches?
Constructor Details
#initialize(name_or_label, **opts) ⇒ HaveField
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of HaveField.
302 303 304 305 306 307 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 302 def initialize(name_or_label, **opts) super("input, textarea, select", text: nil, **opts.reject { |k, _| %i[with type].include?(k) }) @locator = name_or_label @with_value = opts[:with] @type_filter = opts[:type] end |