summaryrefslogtreecommitdiff
path: root/users/test/unit/user_test.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2014-04-17 10:12:05 +0200
committerazul <azul@riseup.net>2014-04-17 10:12:05 +0200
commit3513ad74f950b113af1ba1e3d06bc6a55c48fde5 (patch)
treedb49ebd4428053d5c8d720275b77594a531a1ad1 /users/test/unit/user_test.rb
parentcb6442c344d6bdaf52c3878b2de2fcf4d85f2648 (diff)
parent3d3688647fab7049e5b531c45b85c1e46a1d528f (diff)
Merge pull request #146 from azul/refactor/engines
Refactor/engines
Diffstat (limited to 'users/test/unit/user_test.rb')
-rw-r--r--users/test/unit/user_test.rb68
1 files changed, 0 insertions, 68 deletions
diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb
deleted file mode 100644
index ffbb7d8..0000000
--- a/users/test/unit/user_test.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require 'test_helper'
-
-class UserTest < ActiveSupport::TestCase
-
- include SRP::Util
- setup do
- @user = FactoryGirl.build(:user)
- end
-
- test "design docs in database are authorative" do
- assert !User.design_doc.auto_update,
- "Automatic update of design docs should be disabled"
- end
-
- test "test set of attributes should be valid" do
- @user.valid?
- assert_equal Hash.new, @user.errors.messages
- end
-
- test "test require hex for password_verifier" do
- @user.password_verifier = "QWER"
- assert !@user.valid?
- end
-
- test "test require alphanumerical for login" do
- @user.login = "qw#r"
- assert !@user.valid?
- end
-
- test "verifier returns number for the hex in password_verifier" do
- assert_equal @user.password_verifier.hex, @user.verifier
- end
-
- test "salt returns number for the hex in password_salt" do
- assert_equal @user.password_salt.hex, @user.salt
- end
-
- test 'normal user is no admin' do
- assert !@user.is_admin?
- end
-
- test 'user with login in APP_CONFIG is an admin' do
- admin_login = APP_CONFIG['admins'].first
- @user.login = admin_login
- assert @user.is_admin?
- end
-
- test "login needs to be unique" do
- other_user = FactoryGirl.create :user, login: @user.login
- assert !@user.valid?
- other_user.destroy
- end
-
- test "login needs to be unique amongst aliases" do
- other_user = FactoryGirl.create :user
- id = Identity.create_for other_user, address: @user.login
- assert !@user.valid?
- id.destroy
- other_user.destroy
- end
-
- test "deprecated public key api still works" do
- key = SecureRandom.base64(4096)
- @user.public_key = key
- assert_equal key, @user.public_key
- end
-
-end