Merging in Master

This commit is contained in:
ilya 2010-07-12 11:28:39 -07:00
commit 174eb7e8f7
5 changed files with 27 additions and 8 deletions

View file

@ -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"

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -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