##// END OF EJS Templates
Converted routing and urls to follow the Rails REST convention....
Converted routing and urls to follow the Rails REST convention. Patch supplied by commits from Gerrit Kaiser on Github. Existing routes will still work (backwards compatible) but any new urls will be generated using the new routing rules. Changes listed below: * made the URLs for some project tabs and project settings follow the new rails RESTful conventions of /collection/:id/subcollection/:sub_id * prettier URL for project roadmap * more nice project URLs * use GET for filtering form * prettified URLs used on issues tab * custom route for activity atom feeds * prettier repository urls * fixed broken route definition * fixed failing tests for issuecontroller that were hardcoding the url string * more RESTful routes for boards and messages * RESTful routes for wiki pages * RESTful routes for documents * moved old routes that are retained for compatibility to the bottom and grouped them together * added RESTful URIs for issues * RESTfulness for the news section * fixed route order * changed hardcoded URLs in tests * fixed badly written tests * fixed forgotten parameter in routes * changed hardcoded URLS to new scheme * changed project add url to the standard POST to collection * create new issue by POSTing to collection * changed hardcoded URLs in integrations tests * made project add form work again * restful routes for project deletion * prettier routes for project (un)archival * made routes table more readable * fixed note quoting * user routing * fixed bug * always sort by GET * Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled. * prettified URLs used on issues tab * urls for time log * fixed reply routing * eliminate revision query paremeter for diff and entry actions * fixed test failures with hard-coded urls * ensure ajax links always use get * refactored ajax link generation into separate method #1901 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2317 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r2315:765f7abc6033
r2315:765f7abc6033
Show More
admin_test.rb
66 lines | 2.6 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
v0.2.0...
r5 # redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
#
# 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.
require "#{File.dirname(__FILE__)}/../test_helper"
class AdminTest < ActionController::IntegrationTest
fixtures :users
def test_add_user
log_user("admin", "admin")
get "/users/add"
assert_response :success
assert_template "users/add"
Jean-Philippe Lang
0.3 unstable...
r10 post "/users/add", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
Jean-Philippe Lang
v0.2.0...
r5 assert_redirected_to "users/list"
Jean-Philippe Lang
0.3 unstable...
r10 user = User.find_by_login("psmith")
Jean-Philippe Lang
v0.2.0...
r5 assert_kind_of User, user
Jean-Philippe Lang
0.3 unstable...
r10 logged_user = User.try_to_login("psmith", "psmith09")
Jean-Philippe Lang
v0.2.0...
r5 assert_kind_of User, logged_user
Jean-Philippe Lang
0.3 unstable...
r10 assert_equal "Paul", logged_user.firstname
Jean-Philippe Lang
v0.2.0...
r5
Jean-Philippe Lang
0.3 unstable...
r10 post "users/edit", :id => user.id, :user => { :status => User::STATUS_LOCKED }
Jean-Philippe Lang
v0.2.0...
r5 assert_redirected_to "users/list"
Jean-Philippe Lang
0.3 unstable...
r10 locked_user = User.try_to_login("psmith", "psmith09")
Jean-Philippe Lang
v0.2.0...
r5 assert_equal nil, locked_user
end
def test_add_project
log_user("admin", "admin")
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 get "projects/new"
Jean-Philippe Lang
v0.2.0...
r5 assert_response :success
assert_template "projects/add"
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 post "projects", :project => { :name => "blog",
Jean-Philippe Lang
Fix: error when posting to projects/add or users/add with no custom_fields parameter....
r664 :description => "weblog",
:identifier => "blog",
Jean-Philippe Lang
Custom fields refactoring: most of code moved from controllers to models (using new module ActsAsCustomizable)....
r1578 :is_public => 1,
:custom_field_values => { '3' => 'Beta' }
}
Jean-Philippe Lang
v0.2.0...
r5 assert_redirected_to "admin/projects"
Jean-Philippe Lang
notice messages translation...
r15 assert_equal 'Successful creation.', flash[:notice]
Jean-Philippe Lang
v0.2.0...
r5
project = Project.find_by_name("blog")
assert_kind_of Project, project
Jean-Philippe Lang
0.3 unstable...
r10 assert_equal "weblog", project.description
Jean-Philippe Lang
v0.2.0...
r5 assert_equal true, project.is_public?
get "admin/projects"
assert_response :success
assert_template "admin/projects"
end
end