diff --git a/Gemfile b/Gemfile index 4436fb08d..a5df7bd95 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source 'http://rubygems.org' source 'http://gemcutter.org' -gem 'rails', :git =>'http://github.com/rails/rails.git' -gem 'bundler', '1.0.0.beta.4' +gem 'rails', '3.0.0.beta4' +gem 'bundler' gem 'mongo_mapper', :git => "http://github.com/BadMinus/mongomapper.git" gem 'devise', :git => "http://github.com/BadMinus/devise.git" gem 'jnunemaker-validatable', :git => "http://github.com/BadMinus/validatable.git" 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/db/seeds/backer.rb b/db/seeds/backer.rb index a4d5c48d4..13be3e6be 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -52,7 +52,10 @@ def create(backer_number, password) # Create seed user email = backer_info[backer_number][2].gsub(/ /,'').downcase - user = User.create( :email => "#{email}@joindiaspora.com", :password => "#{email+backer_info[backer_number][0].to_s}", :profile => Profile.create( :first_name => backer_info[backer_number][1], :last_name => backer_info[backer_number][2] )) + user = User.create( :email => "#{email}@joindiaspora.com", + :password => "#{email+backer_info[backer_number][0].to_s}", + :profile => Profile.create( :first_name => backer_info[backer_number][1], :last_name => backer_info[backer_number][2] ), + :url=> "#{email}.joindiaspora.com") # Make connection with Diaspora Tom Person.create( :email => "tom@joindiaspora.com", :url => "http://tom.joindiaspora.com/", :active => true, :profile => Profile.create(:first_name => "Alexander", :last_name => "Hamiltom")) @@ -60,7 +63,10 @@ def create(backer_number, password) (0..10).each { |n| email = backer_info[n][2].gsub(/ /,'').downcase - Person.create( :email => "#{email}@joindiaspora.com", :url => "http://#{email}.joindiaspora.com/", :active => true, :profile => Profile.create(:first_name => backer_info[n][1], :last_name => backer_info[n][2])) unless n == backer_number + Person.create( :email => "#{email}@joindiaspora.com", + :url => "http://#{email}.joindiaspora.com/", + :active => true, + :profile => Profile.create(:first_name => backer_info[n][1], :last_name => backer_info[n][2])) unless n == backer_number } end 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