fix account deletion specs
This commit is contained in:
parent
af7962e2e8
commit
fb39a1e16d
2 changed files with 3 additions and 5 deletions
|
|
@ -13,7 +13,7 @@ class AccountDeletion < ActiveRecord::Base
|
||||||
attr_accessible :person
|
attr_accessible :person
|
||||||
|
|
||||||
xml_name :account_deletion
|
xml_name :account_deletion
|
||||||
xml_attr :diaspora_handle
|
xml_attr :diaspora_handle
|
||||||
|
|
||||||
def person=(person)
|
def person=(person)
|
||||||
self[:diaspora_handle] = person.diaspora_handle
|
self[:diaspora_handle] = person.diaspora_handle
|
||||||
|
|
@ -25,12 +25,10 @@ class AccountDeletion < ActiveRecord::Base
|
||||||
self[:person_id] ||= Person.find_by_diaspora_handle(diaspora_handle).id
|
self[:person_id] ||= Person.find_by_diaspora_handle(diaspora_handle).id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def queue_delete_account
|
def queue_delete_account
|
||||||
Resque.enqueue(Jobs::DeleteAccount, self.id)
|
Resque.enqueue(Jobs::DeleteAccount, self.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform!
|
def perform!
|
||||||
self.dispatch if person.local?
|
self.dispatch if person.local?
|
||||||
AccountDeleter.new(self.diaspora_handle).perform!
|
AccountDeleter.new(self.diaspora_handle).perform!
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ describe UsersController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'enqueues a delete job' do
|
it 'enqueues a delete job' do
|
||||||
Resque.should_receive(:enqueue).with(Jobs::DeleteAccount, alice.id)
|
Resque.should_receive(:enqueue).with(Jobs::DeleteAccount, anything)
|
||||||
delete :destroy, :user => { :current_password => "bluepin7" }
|
delete :destroy, :user => { :current_password => "bluepin7" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue