Mercurial > hg > soundsoftware-site
comparison test/functional/auto_completes_controller_test.rb @ 1298:4f746d8966dd redmine_2.3_integration
Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:28:30 +0100 |
parents | 622f24f53b42 |
children | e248c7af89ec |
comparison
equal
deleted
inserted
replaced
1297:0a574315af3e | 1298:4f746d8966dd |
---|---|
1 # Redmine - project management software | |
2 # Copyright (C) 2006-2013 Jean-Philippe Lang | |
3 # | |
4 # This program is free software; you can redistribute it and/or | |
5 # modify it under the terms of the GNU General Public License | |
6 # as published by the Free Software Foundation; either version 2 | |
7 # of the License, or (at your option) any later version. | |
8 # | |
9 # This program is distributed in the hope that it will be useful, | |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 # GNU General Public License for more details. | |
13 # | |
14 # You should have received a copy of the GNU General Public License | |
15 # along with this program; if not, write to the Free Software | |
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 | |
1 require File.expand_path('../../test_helper', __FILE__) | 18 require File.expand_path('../../test_helper', __FILE__) |
2 | 19 |
3 class AutoCompletesControllerTest < ActionController::TestCase | 20 class AutoCompletesControllerTest < ActionController::TestCase |
4 fixtures :projects, :issues, :issue_statuses, | 21 fixtures :projects, :issues, :issue_statuses, |
5 :enumerations, :users, :issue_categories, | 22 :enumerations, :users, :issue_categories, |
7 :projects_trackers, | 24 :projects_trackers, |
8 :roles, | 25 :roles, |
9 :member_roles, | 26 :member_roles, |
10 :members, | 27 :members, |
11 :enabled_modules, | 28 :enabled_modules, |
12 :workflows, | |
13 :journals, :journal_details | 29 :journals, :journal_details |
14 | 30 |
15 def test_issues_should_not_be_case_sensitive | 31 def test_issues_should_not_be_case_sensitive |
16 get :issues, :project_id => 'ecookbook', :q => 'ReCiPe' | 32 get :issues, :project_id => 'ecookbook', :q => 'ReCiPe' |
17 assert_response :success | 33 assert_response :success |
26 assert assigns(:issues).detect {|issue| issue.subject.match /recipe/} | 42 assert assigns(:issues).detect {|issue| issue.subject.match /recipe/} |
27 end | 43 end |
28 | 44 |
29 def test_issues_should_return_issue_with_given_id | 45 def test_issues_should_return_issue_with_given_id |
30 get :issues, :project_id => 'subproject1', :q => '13' | 46 get :issues, :project_id => 'subproject1', :q => '13' |
47 assert_response :success | |
48 assert_not_nil assigns(:issues) | |
49 assert assigns(:issues).include?(Issue.find(13)) | |
50 end | |
51 | |
52 def test_issues_should_return_issue_with_given_id_preceded_with_hash | |
53 get :issues, :project_id => 'subproject1', :q => '#13' | |
31 assert_response :success | 54 assert_response :success |
32 assert_not_nil assigns(:issues) | 55 assert_not_nil assigns(:issues) |
33 assert assigns(:issues).include?(Issue.find(13)) | 56 assert assigns(:issues).include?(Issue.find(13)) |
34 end | 57 end |
35 | 58 |