push changes
This commit is contained in:
parent
c3832cd2a7
commit
18760f13f8
3 changed files with 17 additions and 4 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue