openstreetmap-website/test/functional/user_roles_controller_test.rb
Tom Hughes 5f33656c8d Get rid of custom CSRF protection for user role changes
By restricting role changes to POST requests, which they should be
anyway, we get all the rails CSRF protection for free.
2012-03-20 17:21:13 +00:00

16 lines
614 B
Ruby

require File.dirname(__FILE__) + '/../test_helper'
class UserRolesControllerTest < ActionController::TestCase
##
# test all routes which lead to this controller
def test_routes
assert_routing(
{ :path => "/user/username/role/rolename/grant", :method => :post },
{ :controller => "user_roles", :action => "grant", :display_name => "username", :role => "rolename" }
)
assert_routing(
{ :path => "/user/username/role/rolename/revoke", :method => :post },
{ :controller => "user_roles", :action => "revoke", :display_name => "username", :role => "rolename" }
)
end
end