intentional failing test in user for tomorrow.

This commit is contained in:
danielvincent 2010-08-15 21:03:19 -07:00
parent 80b81c1ae1
commit f1f827120b
3 changed files with 27 additions and 2 deletions

View file

@ -5,9 +5,11 @@ class Group
key :person_ids, Array
key :request_ids, Array
key :post_ids, Array
many :people, :in => :person_ids, :class_name => 'Person'
many :requests, :in => :request_ids, :class_name => 'Request'
many :posts, :in => :post_ids, :class_name => 'Post'
belongs_to :user, :class_name => 'User'

View file

@ -162,7 +162,8 @@ class User
person.profile = object
person.save
elsif object.verify_creator_signature == true
Rails.logger.debug("Saving object with success: #{object.save}")
Rails.logger.debug("Saving object: #{object}")
object.save
object.socket_to_uid( id) if object.respond_to? :socket_to_uid
end
end

View file

@ -12,6 +12,29 @@ describe Diaspora::Parser do
@person = Factory.create(:person_with_private_key, :email => "bill@gates.com")
@user2 = Factory.create(:user)
end
it "should associate the post with a group" do
@user.activate_friend(@person, @group)
status_message = Factory.build(:status_message, :message => "hey!", :person => @person)
@user.receive status_message.to_diaspora_xml
# mongomapper doesn't support joins, meaning we can't do a query
# on user.groups.
# should this code below be a function of a user?
# something like self.find_group_for(friend_id) ?
groups = @user.groups
groups.shift while not groups[0].person_ids.include?(@person.id)
group = groups[0]
####
@group.posts.count.should == 1
end
describe 'with encryption' do
before do
unstub_mocha_stubs
@ -38,7 +61,6 @@ describe Diaspora::Parser do
</XML>"
@user.receive xml
Post.count.should == 0
end
end