##// END OF EJS Templates
Speeds up rendering of the project list for users who belong to hundreds of projects....
Speeds up rendering of the project list for users who belong to hundreds of projects. git-svn-id: http://svn.redmine.org/redmine/trunk@16123 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r15313:ec31b616982f
r15741:f8df935dcada
Show More
auto_completes_controller_test.rb
84 lines | 2.9 KiB | text/x-ruby | RubyLexer
/ test / functional / auto_completes_controller_test.rb
Jean-Philippe Lang
Functional tests cleanup....
r10709 # Redmine - project management software
Jean-Philippe Lang
Updates copyright for 2016....
r14856 # Copyright (C) 2006-2016 Jean-Philippe Lang
Jean-Philippe Lang
Functional tests cleanup....
r10709 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Eric Davis
Refactor: move IssuesController#auto_complete to a new controller. #4382...
r3831
Jean-Philippe Lang
Adds our own class for controller tests....
r15279 class AutoCompletesControllerTest < Redmine::ControllerTest
Toshi MARUYAMA
Rails3: replace "all" fixtures at test/functional/auto_completes_controller_test.rb...
r7368 fixtures :projects, :issues, :issue_statuses,
:enumerations, :users, :issue_categories,
:trackers,
:projects_trackers,
:roles,
:member_roles,
:members,
:enabled_modules,
:journals, :journal_details
Eric Davis
Refactor: move IssuesController#auto_complete to a new controller. #4382...
r3831
def test_issues_should_not_be_case_sensitive
get :issues, :project_id => 'ecookbook', :q => 'ReCiPe'
assert_response :success
Jean-Philippe Lang
Removes calls to #assert_template and #assigns in functional tests....
r15313 assert_include "recipe", response.body
Eric Davis
Refactor: move IssuesController#auto_complete to a new controller. #4382...
r3831 end
Toshi MARUYAMA
remove trailing white-spaces from test/functional/auto_completes_controller_test.rb....
r6703
Jean-Philippe Lang
Code cleanup....
r9997 def test_issues_should_accept_term_param
get :issues, :project_id => 'ecookbook', :term => 'ReCiPe'
assert_response :success
Jean-Philippe Lang
Removes calls to #assert_template and #assigns in functional tests....
r15313 assert_include "recipe", response.body
Jean-Philippe Lang
Code cleanup....
r9997 end
Eric Davis
Refactor: move IssuesController#auto_complete to a new controller. #4382...
r3831 def test_issues_should_return_issue_with_given_id
get :issues, :project_id => 'subproject1', :q => '13'
assert_response :success
Jean-Philippe Lang
Removes calls to #assert_template and #assigns in functional tests....
r15313 assert_include "Bug #13", response.body
Eric Davis
Refactor: move IssuesController#auto_complete to a new controller. #4382...
r3831 end
Toshi MARUYAMA
remove trailing white-spaces from test/functional/auto_completes_controller_test.rb....
r6703
Jean-Philippe Lang
Makes autocomplete accept issue id with hash....
r11062 def test_issues_should_return_issue_with_given_id_preceded_with_hash
get :issues, :project_id => 'subproject1', :q => '#13'
assert_response :success
Jean-Philippe Lang
Removes calls to #assert_template and #assigns in functional tests....
r15313 assert_include "Bug #13", response.body
Jean-Philippe Lang
Makes autocomplete accept issue id with hash....
r11062 end
Jean-Philippe Lang
Code cleanup....
r9997 def test_auto_complete_with_scope_all_should_search_other_projects
Jean-Philippe Lang
Autocomplete issue relations on subject (#3170)....
r4388 get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all'
assert_response :success
Jean-Philippe Lang
Removes calls to #assert_template and #assigns in functional tests....
r15313 assert_include "Bug #13", response.body
Jean-Philippe Lang
Autocomplete issue relations on subject (#3170)....
r4388 end
Toshi MARUYAMA
remove trailing white-spaces from test/functional/auto_completes_controller_test.rb....
r6703
Jean-Philippe Lang
Adds autocomplete to issue field on time logging form....
r9999 def test_auto_complete_without_project_should_search_all_projects
get :issues, :q => '13'
assert_response :success
Jean-Philippe Lang
Removes calls to #assert_template and #assigns in functional tests....
r15313 assert_include "Bug #13", response.body
Jean-Philippe Lang
Adds autocomplete to issue field on time logging form....
r9999 end
Jean-Philippe Lang
Code cleanup....
r9997 def test_auto_complete_without_scope_all_should_not_search_other_projects
get :issues, :project_id => 'ecookbook', :q => '13'
Jean-Philippe Lang
Autocomplete issue relations on subject (#3170)....
r4388 assert_response :success
Jean-Philippe Lang
Removes calls to #assert_template and #assigns in functional tests....
r15313 assert_not_include "Bug #13", response.body
Jean-Philippe Lang
Autocomplete issue relations on subject (#3170)....
r4388 end
Jean-Philippe Lang
Code cleanup....
r9997
def test_issues_should_return_json
get :issues, :project_id => 'subproject1', :q => '13'
assert_response :success
json = ActiveSupport::JSON.decode(response.body)
assert_kind_of Array, json
issue = json.first
assert_kind_of Hash, issue
assert_equal 13, issue['id']
assert_equal 13, issue['value']
assert_equal 'Bug #13: Subproject issue two', issue['label']
end
Eric Davis
Refactor: move IssuesController#auto_complete to a new controller. #4382...
r3831 end