Make the UsersController more RESTy. It now supports retrieving a list of users or a particular as XML (available to admins only).

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@412 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-01-31 05:36:33 +00:00
parent b1b03b2c8a
commit ef2d93542e
7 changed files with 79 additions and 38 deletions

View file

@ -1,6 +1,5 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'users_controller'
require 'user'
# Re-raise errors caught by the controller.
class UsersController; def rescue_action(e) raise e end; end
@ -34,6 +33,9 @@ class UsersControllerTest < Test::Unit::TestCase
login_as @admin_user
get :index
assert_response :success
assert_equal "TRACKS::Manage Users", assigns['page_title']
assert_equal 3, assigns['total_users']
assert_equal "/users", session['return-to']
end
def test_destroy_user
@ -154,7 +156,6 @@ class UsersControllerTest < Test::Unit::TestCase
def assert_number_of_users_is_unchanged
assert_equal User.count, @num_users_in_fixture
end
end
end