summaryrefslogtreecommitdiff
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index 9501d34..55d0648 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -71,6 +71,14 @@ class UserTest < ActiveSupport::TestCase
assert_equal key, @user.public_key
end
+ test "user to json includes id, login, valid, is_admin and enabled" do
+ json_content = JSON.parse @user.to_json
+ assert_equal @user.id, json_content["id"]
+ assert_equal @user.valid?, json_content["ok"]
+ assert_equal @user.login, json_content["login"]
+ assert_equal @user.enabled?, json_content["enabled"]
+ assert_equal @user.is_admin?, json_content["is_admin"]
+ end
#