Class: SunspotMatchers::HaveDynamicField

Inherits:
HaveSearchableField show all
Defined in:
lib/sunspot_matchers/matchers.rb

Instance Method Summary collapse

Methods inherited from HaveSearchableField

#initialize, #matches?, #sunspot

Constructor Details

This class inherits a constructor from SunspotMatchers::HaveSearchableField

Instance Method Details

#descriptionObject



365
366
367
# File 'lib/sunspot_matchers/matchers.rb', line 365

def description
  "have dynamic searchable field '#{@field}'"
end

#failure_messageObject



369
370
371
372
# File 'lib/sunspot_matchers/matchers.rb', line 369

def failure_message
  message = "expected class: #{@klass} to have dynamic searchable field: #{@field}"
  message << ", but Sunspot was not configured on #{@klass}" unless @sunspot
end

#failure_message_when_negatedObject



374
375
376
# File 'lib/sunspot_matchers/matchers.rb', line 374

def failure_message_when_negated
  "expected class: #{@klass} NOT to have dynamic searchable field: #{@field}"
end

#fields_to_matchObject



378
379
380
# File 'lib/sunspot_matchers/matchers.rb', line 378

def fields_to_match
  sunspot.dynamic_field_factories.collect(&:name)
end