Module: SunspotMatchers::TestHelper

Defined in:
lib/sunspot_matchers/test_helper.rb

Instance Method Summary collapse

Instance Method Details

#assert_has_no_search_params(session, *method_and_args, &block) ⇒ Object



72
73
74
75
76
# File 'lib/sunspot_matchers/test_helper.rb', line 72

def assert_has_no_search_params(session, *method_and_args, &block)
  method, *args = method_and_args
  matcher = HaveSearchParamsForSession.new(session, method, *args, &block).get_matcher
  assert !matcher.match?, matcher.unexpected_match_error_message
end

#assert_has_search_params(session, *method_and_args, &block) ⇒ Object



66
67
68
69
70
# File 'lib/sunspot_matchers/test_helper.rb', line 66

def assert_has_search_params(session, *method_and_args, &block)
  method, *args = method_and_args
  matcher = HaveSearchParamsForSession.new(session, method, *args, &block).get_matcher
  assert matcher.match?, matcher.missing_param_error_message
end

#assert_is_not_search_for(session, expected_class) ⇒ Object



83
84
85
86
# File 'lib/sunspot_matchers/test_helper.rb', line 83

def assert_is_not_search_for(session, expected_class)
  matcher = BeASearchForSession.new(session, expected_class)
  assert !matcher.match?, matcher.failure_message_for_should_not
end

#assert_is_search_for(session, expected_class) ⇒ Object



78
79
80
81
# File 'lib/sunspot_matchers/test_helper.rb', line 78

def assert_is_search_for(session, expected_class)
  matcher = BeASearchForSession.new(session, expected_class)
  assert matcher.match?, matcher.failure_message_for_should
end