diff --git a/app/models/retraction.rb b/app/models/retraction.rb index c799df5fd..538f89513 100644 --- a/app/models/retraction.rb +++ b/app/models/retraction.rb @@ -19,7 +19,7 @@ class Retraction attr_accessor :type def perform - puts('GO GO GO') + puts self.inspect self.type.constantize.destroy(self.post_id) end @@ -35,7 +35,7 @@ class Retraction def self.type_name(object) if object.is_a? Post object.class - elsif object.is_a? User + elsif object.is_a? Person 'Person' else 'Clowntown' diff --git a/spec/lib/parser_spec.rb b/spec/lib/parser_spec.rb index 36150b3ea..92673e06c 100644 --- a/spec/lib/parser_spec.rb +++ b/spec/lib/parser_spec.rb @@ -141,6 +141,21 @@ describe "parser in application helper" do Person.where(:url => @person.url).first.active.should be true end + + it 'should marshal a retraction for a person' do + retraction = Retraction.for(@user) + + request = Retraction.build_xml_for( [retraction] ) + + + puts request.inspect + + Person.count.should == 2 + store_objects_from_xml( request ) + Person.count.should == 1 + + end + end end diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 8c6dd30bf..a882b9849 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -62,11 +62,9 @@ describe Person do f = Factory.create(:person, :active => true) - Person.friends.all.count.should == 1 u.unfriend(f.id) Person.friends.all.count.should == 0 - end end