2014-05-16 18:03:13 -04:00
|
|
|
require 'test_helper'
|
2012-07-15 20:45:37 +02:00
|
|
|
|
|
|
|
class SearchControllerTest < ActionController::TestCase
|
2020-09-05 01:24:23 +03:00
|
|
|
|
2012-07-15 20:45:37 +02:00
|
|
|
def setup
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_get_search_page
|
|
|
|
login_as :admin_user
|
|
|
|
get :index
|
|
|
|
assert_response 200
|
|
|
|
end
|
2020-09-05 01:24:23 +03:00
|
|
|
|
2012-07-15 20:45:37 +02:00
|
|
|
def test_search_for_todo_with_tag
|
|
|
|
login_as :admin_user
|
2018-11-03 11:00:27 -05:00
|
|
|
post :results, params: { :search => "gates" }
|
2012-07-15 20:45:37 +02:00
|
|
|
assert_response 200
|
|
|
|
assert_equal 3, assigns['count'], "should have found 3 todos"
|
|
|
|
end
|
2020-09-05 01:24:23 +03:00
|
|
|
|
2012-07-15 20:45:37 +02:00
|
|
|
end
|