pushing so dan can look at how to stub EM:next_tick correctly

This commit is contained in:
maxwell 2010-11-27 11:54:51 -08:00 committed by danielvincent
parent 62b4e85b0b
commit c65c62906c
2 changed files with 4 additions and 2 deletions

View file

@ -75,7 +75,7 @@ module Diaspora
def receive_retraction retraction
if retraction.type == 'Person'
unless retraction.person.id.to_s == retraction.post_id.to_s
Rails.logger.info("event=receive status=abort reason='sender is not the person he is trying to retract' recipient=#{self.diaspora_handle} sender=#{salmon_author.diaspora_handle} payload_type=#{retraction.class} retraction_type=person")
Rails.logger.info("event=receive status=abort reason='sender is not the person he is trying to retract' recipient=#{self.diaspora_handle} sender=#{retraction.person.diaspora_handle} payload_type=#{retraction.class} retraction_type=person")
return
end
disconnected_by visible_person_by_id(retraction.post_id)
@ -147,7 +147,7 @@ module Diaspora
Rails.logger.info("event=receive payload_type=#{post.class} update=false status=complete sender=#{post.diaspora_handle}")
post
else
Rails.logger.info("event=receive payload_type=#{post.class} update=true status=abort sender=#{post.diaspora_handle} reason='update not from post owner' existing_post=#{known_post.id}")
Rails.logger.info("event=receive payload_type=#{post.class} update=true status=abort sender=#{post.diaspora_handle} reason='update not from post owner' existing_post=#{post.id}")
end
end

View file

@ -18,6 +18,8 @@ describe StatusMessagesController do
request.env["HTTP_REFERER"] = ""
sign_in :user, user
@controller.stub!(:current_user).and_return(user)
EM.stub!(:next_tick).with(&block).and_return{|x| x.call}
end
describe '#show' do