annotate .svn/pristine/ea/ead648f8695b39d393ec1029db862f15de288d0d.svn-base @ 1327:287f201c2802 redmine-2.2-integration

Add italic
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Wed, 19 Jun 2013 20:56:22 +0100
parents cbb26bc654de
children
rev   line source
Chris@909 1 require File.expand_path('../../test_helper', __FILE__)
Chris@909 2
Chris@909 3 class AutoCompletesControllerTest < ActionController::TestCase
Chris@909 4 fixtures :projects, :issues, :issue_statuses,
Chris@909 5 :enumerations, :users, :issue_categories,
Chris@909 6 :trackers,
Chris@909 7 :projects_trackers,
Chris@909 8 :roles,
Chris@909 9 :member_roles,
Chris@909 10 :members,
Chris@909 11 :auth_sources,
Chris@909 12 :enabled_modules,
Chris@909 13 :workflows,
Chris@909 14 :journals, :journal_details
Chris@909 15
Chris@909 16 def test_issues_should_not_be_case_sensitive
Chris@909 17 get :issues, :project_id => 'ecookbook', :q => 'ReCiPe'
Chris@909 18 assert_response :success
Chris@909 19 assert_not_nil assigns(:issues)
Chris@909 20 assert assigns(:issues).detect {|issue| issue.subject.match /recipe/}
Chris@909 21 end
Chris@909 22
Chris@909 23 def test_issues_should_return_issue_with_given_id
Chris@909 24 get :issues, :project_id => 'subproject1', :q => '13'
Chris@909 25 assert_response :success
Chris@909 26 assert_not_nil assigns(:issues)
Chris@909 27 assert assigns(:issues).include?(Issue.find(13))
Chris@909 28 end
Chris@909 29
Chris@909 30 def test_auto_complete_with_scope_all_and_cross_project_relations
Chris@909 31 Setting.cross_project_issue_relations = '1'
Chris@909 32 get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all'
Chris@909 33 assert_response :success
Chris@909 34 assert_not_nil assigns(:issues)
Chris@909 35 assert assigns(:issues).include?(Issue.find(13))
Chris@909 36 end
Chris@909 37
Chris@909 38 def test_auto_complete_with_scope_all_without_cross_project_relations
Chris@909 39 Setting.cross_project_issue_relations = '0'
Chris@909 40 get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all'
Chris@909 41 assert_response :success
Chris@909 42 assert_equal [], assigns(:issues)
Chris@909 43 end
Chris@909 44 end