summaryrefslogtreecommitdiff
path: root/test/unit/account_test.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-02-10 10:56:57 -0800
committerelijah <elijah@riseup.net>2016-02-10 10:56:57 -0800
commit49d3e9df74685fe17a2abbbabdd17014f2371065 (patch)
tree41dc44c41659e2f970b84ac2fe0da8152422efee /test/unit/account_test.rb
parent0ba489bdb01bb2f0536d2603bd389d448712e336 (diff)
allow user accounts to be re-enabled, and for associated identities to also get re-enabled.
Diffstat (limited to 'test/unit/account_test.rb')
-rw-r--r--test/unit/account_test.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/unit/account_test.rb b/test/unit/account_test.rb
index 7c26d5c..9680b33 100644
--- a/test/unit/account_test.rb
+++ b/test/unit/account_test.rb
@@ -8,7 +8,7 @@ class AccountTest < ActiveSupport::TestCase
end
teardown do
- Identity.destroy_all_disabled
+ Identity.destroy_all_orphaned
end
test "create a new account when invited" do
@@ -86,8 +86,11 @@ class AccountTest < ActiveSupport::TestCase
cert = stub(expiry: 1.month.from_now, fingerprint: SecureRandom.hex)
user.identity.register_cert cert
user.identity.save
- assert_equal cert.fingerprint, Identity.for(user).cert_fingerprints.keys.first
+ assert_equal(cert.fingerprint, Identity.for(user).cert_fingerprints.keys.first)
user.account.disable
assert_equal({}, Identity.for(user).cert_fingerprints)
+ assert_equal(cert.fingerprint, Identity.for(user).read_attribute(:disabled_cert_fingerprints).keys.first)
+ user.account.enable
+ assert_equal(cert.fingerprint, Identity.for(user).cert_fingerprints.keys.first)
end
end