Class: Dommy::Rails::RSpec::Matchers::HaveNoMissingFormLabels

Inherits:
Object
  • Object
show all
Defined in:
lib/dommy/rails/rspec/matchers.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



639
640
641
# File 'lib/dommy/rails/rspec/matchers.rb', line 639

def description
  "have no missing form labels"
end

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


635
636
637
# File 'lib/dommy/rails/rspec/matchers.rb', line 635

def does_not_match?(actual)
  !matches?(actual)
end

#failure_messageObject



643
644
645
# File 'lib/dommy/rails/rspec/matchers.rb', line 643

def failure_message
  "expected no missing form labels, found #{@issues.size} issues"
end

#failure_message_when_negatedObject



647
648
649
# File 'lib/dommy/rails/rspec/matchers.rb', line 647

def failure_message_when_negated
  "expected missing form labels"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


630
631
632
633
# File 'lib/dommy/rails/rspec/matchers.rb', line 630

def matches?(actual)
  @issues = Dommy::Rails::Lint.missing_form_labels(MatchTarget.document(actual))
  @issues.empty?
end