Skip to content
Snippets Groups Projects
Forked from PortalMEC / portalmec
1476 commits behind the upstream repository.
search_controller_test.rb 715 B
require 'test_helper'

class V1::SearchControllerTest < ActionController::TestCase
  tests V1::SearchController

  setup do
    LearningObject.reindex
    LearningObject.searchkick_index.refresh
    auth_application
  end

  test 'should get index and return :ok' do
    get :index, search_class: 'LearningObject'
    assert_response :ok
  end

  test 'should get index and return :bad_request' do
    get :index
    assert_response :bad_request
  end

  test 'should get autocomplete and return :ok' do
    get :autocomplete, search_class: 'LearningObject'
    assert_response :ok
  end

  test 'should get autocomplete and return :bad_request' do
    get :autocomplete
    assert_response :bad_request
  end

end