0
0
Fork 0

Adding a bunch of tests

This commit is contained in:
Eugen Rochko 2016-02-26 15:28:08 +01:00
parent 44c5958203
commit f16b31f077
22 changed files with 439 additions and 105 deletions

View file

@ -59,4 +59,12 @@ class Account < ActiveRecord::Base
def subscription(webhook_url)
@subscription ||= OStatus2::Subscription.new(self.remote_url, secret: self.secret, token: self.verify_token, webhook: webhook_url, hub: self.hub_url)
end
before_create do
if local?
keypair = OpenSSL::PKey::RSA.new(Rails.env.test? ? 48 : 2048)
self.private_key = keypair.to_pem
self.public_key = keypair.public_key.to_pem
end
end
end