diff options
Diffstat (limited to 'test/functional/auto_completes_controller_test.rb')
-rw-r--r-- | test/functional/auto_completes_controller_test.rb | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/test/functional/auto_completes_controller_test.rb b/test/functional/auto_completes_controller_test.rb index 48a1c7758..5360eac9b 100644 --- a/test/functional/auto_completes_controller_test.rb +++ b/test/functional/auto_completes_controller_test.rb @@ -31,49 +31,43 @@ class AutoCompletesControllerTest < Redmine::ControllerTest def test_issues_should_not_be_case_sensitive get :issues, :project_id => 'ecookbook', :q => 'ReCiPe' assert_response :success - assert_not_nil assigns(:issues) - assert assigns(:issues).detect {|issue| issue.subject.match /recipe/} + assert_include "recipe", response.body end def test_issues_should_accept_term_param get :issues, :project_id => 'ecookbook', :term => 'ReCiPe' assert_response :success - assert_not_nil assigns(:issues) - assert assigns(:issues).detect {|issue| issue.subject.match /recipe/} + assert_include "recipe", response.body end def test_issues_should_return_issue_with_given_id get :issues, :project_id => 'subproject1', :q => '13' assert_response :success - assert_not_nil assigns(:issues) - assert assigns(:issues).include?(Issue.find(13)) + assert_include "Bug #13", response.body end def test_issues_should_return_issue_with_given_id_preceded_with_hash get :issues, :project_id => 'subproject1', :q => '#13' assert_response :success - assert_not_nil assigns(:issues) - assert assigns(:issues).include?(Issue.find(13)) + assert_include "Bug #13", response.body end def test_auto_complete_with_scope_all_should_search_other_projects get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all' assert_response :success - assert_not_nil assigns(:issues) - assert assigns(:issues).include?(Issue.find(13)) + assert_include "Bug #13", response.body end def test_auto_complete_without_project_should_search_all_projects get :issues, :q => '13' assert_response :success - assert_not_nil assigns(:issues) - assert assigns(:issues).include?(Issue.find(13)) + assert_include "Bug #13", response.body end def test_auto_complete_without_scope_all_should_not_search_other_projects get :issues, :project_id => 'ecookbook', :q => '13' assert_response :success - assert_equal [], assigns(:issues) + assert_not_include "Bug #13", response.body end def test_issues_should_return_json |