annotate .svn/pristine/2c/2c0e2ce37084f59c8aba6396a829a848205403ce.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration

Fix failure to interpret Javascript when autocompleting members for project
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 11 Sep 2014 10:24:38 +0100
parents e248c7af89ec
children
rev   line source
Chris@1494 1 # Redmine - project management software
Chris@1494 2 # Copyright (C) 2006-2014 Jean-Philippe Lang
Chris@1494 3 #
Chris@1494 4 # This program is free software; you can redistribute it and/or
Chris@1494 5 # modify it under the terms of the GNU General Public License
Chris@1494 6 # as published by the Free Software Foundation; either version 2
Chris@1494 7 # of the License, or (at your option) any later version.
Chris@1494 8 #
Chris@1494 9 # This program is distributed in the hope that it will be useful,
Chris@1494 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@1494 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@1494 12 # GNU General Public License for more details.
Chris@1494 13 #
Chris@1494 14 # You should have received a copy of the GNU General Public License
Chris@1494 15 # along with this program; if not, write to the Free Software
Chris@1494 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@1494 17
Chris@1494 18 require File.expand_path('../../../test_helper', __FILE__)
Chris@1494 19
Chris@1494 20 class RoutingIssuesTest < ActionController::IntegrationTest
Chris@1494 21 def test_issues_rest_actions
Chris@1494 22 assert_routing(
Chris@1494 23 { :method => 'get', :path => "/issues" },
Chris@1494 24 { :controller => 'issues', :action => 'index' }
Chris@1494 25 )
Chris@1494 26 assert_routing(
Chris@1494 27 { :method => 'get', :path => "/issues.pdf" },
Chris@1494 28 { :controller => 'issues', :action => 'index', :format => 'pdf' }
Chris@1494 29 )
Chris@1494 30 assert_routing(
Chris@1494 31 { :method => 'get', :path => "/issues.atom" },
Chris@1494 32 { :controller => 'issues', :action => 'index', :format => 'atom' }
Chris@1494 33 )
Chris@1494 34 assert_routing(
Chris@1494 35 { :method => 'get', :path => "/issues.xml" },
Chris@1494 36 { :controller => 'issues', :action => 'index', :format => 'xml' }
Chris@1494 37 )
Chris@1494 38 assert_routing(
Chris@1494 39 { :method => 'get', :path => "/issues/64" },
Chris@1494 40 { :controller => 'issues', :action => 'show', :id => '64' }
Chris@1494 41 )
Chris@1494 42 assert_routing(
Chris@1494 43 { :method => 'get', :path => "/issues/64.pdf" },
Chris@1494 44 { :controller => 'issues', :action => 'show', :id => '64',
Chris@1494 45 :format => 'pdf' }
Chris@1494 46 )
Chris@1494 47 assert_routing(
Chris@1494 48 { :method => 'get', :path => "/issues/64.atom" },
Chris@1494 49 { :controller => 'issues', :action => 'show', :id => '64',
Chris@1494 50 :format => 'atom' }
Chris@1494 51 )
Chris@1494 52 assert_routing(
Chris@1494 53 { :method => 'get', :path => "/issues/64.xml" },
Chris@1494 54 { :controller => 'issues', :action => 'show', :id => '64',
Chris@1494 55 :format => 'xml' }
Chris@1494 56 )
Chris@1494 57 assert_routing(
Chris@1494 58 { :method => 'post', :path => "/issues.xml" },
Chris@1494 59 { :controller => 'issues', :action => 'create', :format => 'xml' }
Chris@1494 60 )
Chris@1494 61 assert_routing(
Chris@1494 62 { :method => 'get', :path => "/issues/64/edit" },
Chris@1494 63 { :controller => 'issues', :action => 'edit', :id => '64' }
Chris@1494 64 )
Chris@1494 65 assert_routing(
Chris@1494 66 { :method => 'put', :path => "/issues/1.xml" },
Chris@1494 67 { :controller => 'issues', :action => 'update', :id => '1',
Chris@1494 68 :format => 'xml' }
Chris@1494 69 )
Chris@1494 70 assert_routing(
Chris@1494 71 { :method => 'delete', :path => "/issues/1.xml" },
Chris@1494 72 { :controller => 'issues', :action => 'destroy', :id => '1',
Chris@1494 73 :format => 'xml' }
Chris@1494 74 )
Chris@1494 75 end
Chris@1494 76
Chris@1494 77 def test_issues_rest_actions_scoped_under_project
Chris@1494 78 assert_routing(
Chris@1494 79 { :method => 'get', :path => "/projects/23/issues" },
Chris@1494 80 { :controller => 'issues', :action => 'index', :project_id => '23' }
Chris@1494 81 )
Chris@1494 82 assert_routing(
Chris@1494 83 { :method => 'get', :path => "/projects/23/issues.pdf" },
Chris@1494 84 { :controller => 'issues', :action => 'index', :project_id => '23',
Chris@1494 85 :format => 'pdf' }
Chris@1494 86 )
Chris@1494 87 assert_routing(
Chris@1494 88 { :method => 'get', :path => "/projects/23/issues.atom" },
Chris@1494 89 { :controller => 'issues', :action => 'index', :project_id => '23',
Chris@1494 90 :format => 'atom' }
Chris@1494 91 )
Chris@1494 92 assert_routing(
Chris@1494 93 { :method => 'get', :path => "/projects/23/issues.xml" },
Chris@1494 94 { :controller => 'issues', :action => 'index', :project_id => '23',
Chris@1494 95 :format => 'xml' }
Chris@1494 96 )
Chris@1494 97 assert_routing(
Chris@1494 98 { :method => 'post', :path => "/projects/23/issues" },
Chris@1494 99 { :controller => 'issues', :action => 'create', :project_id => '23' }
Chris@1494 100 )
Chris@1494 101 assert_routing(
Chris@1494 102 { :method => 'get', :path => "/projects/23/issues/new" },
Chris@1494 103 { :controller => 'issues', :action => 'new', :project_id => '23' }
Chris@1494 104 )
Chris@1494 105 end
Chris@1494 106
Chris@1494 107 def test_issues_form_update
Chris@1494 108 ["post", "put"].each do |method|
Chris@1494 109 assert_routing(
Chris@1494 110 { :method => method, :path => "/projects/23/issues/update_form" },
Chris@1494 111 { :controller => 'issues', :action => 'update_form', :project_id => '23' }
Chris@1494 112 )
Chris@1494 113 end
Chris@1494 114 end
Chris@1494 115
Chris@1494 116 def test_issues_extra_actions
Chris@1494 117 assert_routing(
Chris@1494 118 { :method => 'get', :path => "/projects/23/issues/64/copy" },
Chris@1494 119 { :controller => 'issues', :action => 'new', :project_id => '23',
Chris@1494 120 :copy_from => '64' }
Chris@1494 121 )
Chris@1494 122 # For updating the bulk edit form
Chris@1494 123 ["get", "post"].each do |method|
Chris@1494 124 assert_routing(
Chris@1494 125 { :method => method, :path => "/issues/bulk_edit" },
Chris@1494 126 { :controller => 'issues', :action => 'bulk_edit' }
Chris@1494 127 )
Chris@1494 128 end
Chris@1494 129 assert_routing(
Chris@1494 130 { :method => 'post', :path => "/issues/bulk_update" },
Chris@1494 131 { :controller => 'issues', :action => 'bulk_update' }
Chris@1494 132 )
Chris@1494 133 end
Chris@1494 134 end