Tests pass again, use id => in retraction.perform
This commit is contained in:
parent
7448684358
commit
68dc74e0b7
3 changed files with 5 additions and 9 deletions
|
|
@ -30,7 +30,7 @@ class Retraction
|
||||||
begin
|
begin
|
||||||
return unless signature_valid?
|
return unless signature_valid?
|
||||||
Rails.logger.debug("Retracting #{self.type} id: #{self.post_id}")
|
Rails.logger.debug("Retracting #{self.type} id: #{self.post_id}")
|
||||||
target = self.type.constantize.first(self.post_id)
|
target = self.type.constantize.first(:id => self.post_id)
|
||||||
target.unsocket_from_uid receiving_user_id if target.respond_to? :unsocket_from_uid
|
target.unsocket_from_uid receiving_user_id if target.respond_to? :unsocket_from_uid
|
||||||
target.destroy
|
target.destroy
|
||||||
rescue NameError
|
rescue NameError
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
||||||
describe Retraction do
|
describe Retraction do
|
||||||
before do
|
before do
|
||||||
@user = Factory.create(:user)
|
@user = Factory.create(:user)
|
||||||
@post = @user.post :status_message, :message => "Destroy!", :to => @user.group(:name => "losers").id
|
|
||||||
@person = Factory.create(:person)
|
@person = Factory.create(:person)
|
||||||
@user.friends << @person
|
@group = @user.group(:name => "Bruisers")
|
||||||
@user.save
|
@user.activate_friend(@person, @group)
|
||||||
|
@post = @user.post :status_message, :message => "Destroy!", :to => @group.id
|
||||||
end
|
end
|
||||||
describe 'serialization' do
|
describe 'serialization' do
|
||||||
it 'should have a post id after serialization' do
|
it 'should have a post id after serialization' do
|
||||||
|
|
@ -18,10 +18,8 @@ describe Retraction do
|
||||||
describe 'dispatching' do
|
describe 'dispatching' do
|
||||||
it 'should dispatch a message on delete' do
|
it 'should dispatch a message on delete' do
|
||||||
Factory.create(:person)
|
Factory.create(:person)
|
||||||
message_queue.should_receive(:add_post_request)
|
Salmon::QUEUE.should_receive :add_post_request
|
||||||
@post.destroy
|
@post.destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ describe User do
|
||||||
|
|
||||||
updated_profile = {:profile => {:first_name => 'bob', :last_name => 'billytown', :image_url => "http://clown.com"}}
|
updated_profile = {:profile => {:first_name => 'bob', :last_name => 'billytown', :image_url => "http://clown.com"}}
|
||||||
|
|
||||||
message_queue.should_receive(:process)
|
|
||||||
|
|
||||||
@user.update_profile(updated_profile).should == true
|
@user.update_profile(updated_profile).should == true
|
||||||
@user.profile.image_url.should == "http://clown.com"
|
@user.profile.image_url.should == "http://clown.com"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue