From d5f0e5b67332e7c72ef9e738678e9b0e220b164b Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 24 Apr 2013 13:37:09 +0200 Subject: added test for pgp key view --- users/test/unit/user_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'users/test/unit') diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb index 10c8b46..c8c837b 100644 --- a/users/test/unit/user_test.rb +++ b/users/test/unit/user_test.rb @@ -64,4 +64,15 @@ class UserTest < ActiveSupport::TestCase other_user.destroy end + test "pgp key view" do + @user.public_key = SecureRandom.base64(4096) + @user.save + + view = User.pgp_key_by_handle.key(@user.login) + + assert_equal 1, view.rows.count + assert result = view.rows.first + assert_equal @user.login, result["key"] + assert_equal @user.public_key, result["value"] + end end -- cgit v1.2.3