Tests pass again, use id => in retraction.perform

This commit is contained in:
Raphael 2010-09-09 18:15:30 -07:00
parent 7448684358
commit 68dc74e0b7
3 changed files with 5 additions and 9 deletions

View file

@ -30,7 +30,7 @@ class Retraction
begin
return unless signature_valid?
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.destroy
rescue NameError

View file

@ -3,10 +3,10 @@ require File.dirname(__FILE__) + '/../spec_helper'
describe Retraction do
before do
@user = Factory.create(:user)
@post = @user.post :status_message, :message => "Destroy!", :to => @user.group(:name => "losers").id
@person = Factory.create(:person)
@user.friends << @person
@user.save
@group = @user.group(:name => "Bruisers")
@user.activate_friend(@person, @group)
@post = @user.post :status_message, :message => "Destroy!", :to => @group.id
end
describe 'serialization' do
it 'should have a post id after serialization' do
@ -18,10 +18,8 @@ describe Retraction do
describe 'dispatching' do
it 'should dispatch a message on delete' do
Factory.create(:person)
message_queue.should_receive(:add_post_request)
Salmon::QUEUE.should_receive :add_post_request
@post.destroy
end
end
end

View file

@ -12,8 +12,6 @@ describe User do
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.profile.image_url.should == "http://clown.com"
end