Class: SunspotMatchers::HaveDynamicField
Instance Method Summary
collapse
#initialize, #matches?, #sunspot
Instance Method Details
#description ⇒ Object
365
366
367
|
# File 'lib/sunspot_matchers/matchers.rb', line 365
def description
"have dynamic searchable field '#{@field}'"
end
|
#failure_message ⇒ Object
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_negated ⇒ Object
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_match ⇒ Object
378
379
380
|
# File 'lib/sunspot_matchers/matchers.rb', line 378
def fields_to_match
sunspot.dynamic_field_factories.collect(&:name)
end
|