summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-03 20:21:03 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-03 20:21:03 +0000
commit5222650d952390d3435848397a46d8aa1dbda09e (patch)
tree6ef084faa30f3bba0d0d1e361247f86c1f4da21d /test/integration
parent1059f9a99ec41a8e320d4d66684e65d183270920 (diff)
downloadredmine-5222650d952390d3435848397a46d8aa1dbda09e.tar.gz
redmine-5222650d952390d3435848397a46d8aa1dbda09e.zip
Adds a few tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@13695 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/users_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/api_test/users_test.rb b/test/integration/api_test/users_test.rb
index 22b6abeff..beadc54c6 100644
--- a/test/integration/api_test/users_test.rb
+++ b/test/integration/api_test/users_test.rb
@@ -20,6 +20,26 @@ require File.expand_path('../../../test_helper', __FILE__)
class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
fixtures :users, :members, :member_roles, :roles, :projects
+ test "GET /users.xml should return users" do
+ get '/users.xml', {}, credentials('admin')
+
+ assert_response :success
+ assert_equal 'application/xml', response.content_type
+ assert_select 'users' do
+ assert_select 'user', assigns(:users).size
+ end
+ end
+
+ test "GET /users.json should return users" do
+ get '/users.json', {}, credentials('admin')
+
+ assert_response :success
+ assert_equal 'application/json', response.content_type
+ json = ActiveSupport::JSON.decode(response.body)
+ assert json.key?('users')
+ assert_equal assigns(:users).size, json['users'].size
+ end
+
test "GET /users/:id.xml should return the user" do
get '/users/2.xml'