Skip to content
Extraits de code Groupes Projets
Valider f2e327d9 rédigé par Raphael's avatar Raphael
Parcourir les fichiers

User factory now works

parent 0f596af5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -72,7 +72,6 @@ protected ...@@ -72,7 +72,6 @@ protected
end end
def propagate_retraction def propagate_retraction
puts 'propagating retraction'
Retraction.for(self).notify_people Retraction.for(self).notify_people
end end
......
...@@ -8,7 +8,6 @@ class Retraction ...@@ -8,7 +8,6 @@ class Retraction
retraction.post_id= object.id retraction.post_id= object.id
retraction.person_id = person_id_from(object) retraction.person_id = person_id_from(object)
retraction.type = object.class.to_s retraction.type = object.class.to_s
puts retraction.inspect
retraction retraction
end end
......
...@@ -17,7 +17,6 @@ module Diaspora ...@@ -17,7 +17,6 @@ module Diaspora
end end
def push_to(recipients) def push_to(recipients)
puts "recipients are #{recipients.inspect}"
unless recipients.empty? unless recipients.empty?
recipients.map!{|x| x = x.url + "receive/"} recipients.map!{|x| x = x.url + "receive/"}
xml = Post.build_xml_for(self) xml = Post.build_xml_for(self)
......
...@@ -20,12 +20,14 @@ Factory.define :person_with_private_key, :parent => :person do |p| ...@@ -20,12 +20,14 @@ Factory.define :person_with_private_key, :parent => :person do |p|
p.serialized_key OpenSSL::PKey::RSA.generate(1024).export p.serialized_key OpenSSL::PKey::RSA.generate(1024).export
end end
Factory.define :person_with_user, :parent => :person_with_private_key do |p|
end
Factory.define :user do |u| Factory.define :user do |u|
u.sequence(:email) {|n| "bob#{n}@aol.com"} u.sequence(:email) {|n| "bob#{n}@aol.com"}
u.password "bluepin7" u.password "bluepin7"
u.password_confirmation "bluepin7" u.password_confirmation "bluepin7"
u.person { |a| Factory.create(:person_with_user, :owner_id => a._id)}
u.sequence(:person) {|p| Factory.create(:person_with_private_key, :email => "robert-#{p}@grimm.org")}
end end
Factory.define :status_message do |m| Factory.define :status_message do |m|
......
...@@ -12,6 +12,11 @@ describe 'making sure the spec runner works' do ...@@ -12,6 +12,11 @@ describe 'making sure the spec runner works' do
User.count.should == 0 User.count.should == 0
end end
it 'should factory create a user with a person saved' do
user = Factory.create(:user)
loaded_user = User.first(:id => user.id)
loaded_user.person.owner_id.should == user.id
end
describe 'testing a before do block' do describe 'testing a before do block' do
before do before do
Factory.create(:user) Factory.create(:user)
......
...@@ -3,7 +3,6 @@ require File.dirname(__FILE__) + '/../spec_helper' ...@@ -3,7 +3,6 @@ require File.dirname(__FILE__) + '/../spec_helper'
describe Retraction do describe Retraction do
before do before do
@user = Factory.create(:user) @user = Factory.create(:user)
@user.person.save
@post = @user.post(:status_message, :message => "Destroy!") @post = @user.post(:status_message, :message => "Destroy!")
@person = Factory.create(:person) @person = Factory.create(:person)
@user.friends << @person @user.friends << @person
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter