summaryrefslogtreecommitdiff
path: root/users/test/unit/user_test.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-04-25 09:47:01 -0700
committerjessib <jessib@riseup.net>2013-04-25 09:47:01 -0700
commit4927abe188c7615fe6844ae0e20144b116a52a99 (patch)
treee4f333fbb0eded2fc0c2a13ac693b0591c98678b /users/test/unit/user_test.rb
parentfb66f8e30d302b7230d22112aebe2fcb4912c3f0 (diff)
parentd5f0e5b67332e7c72ef9e738678e9b0e220b164b (diff)
Merge pull request #44 from azul/bugfix/2298-fix-couchdb-view
Bugfix/2298 fix couchdb view
Diffstat (limited to 'users/test/unit/user_test.rb')
-rw-r--r--users/test/unit/user_test.rb11
1 files changed, 11 insertions, 0 deletions
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