intentional failing test in user for tomorrow.
This commit is contained in:
parent
80b81c1ae1
commit
f1f827120b
3 changed files with 27 additions and 2 deletions
|
|
@ -5,9 +5,11 @@ class Group
|
||||||
|
|
||||||
key :person_ids, Array
|
key :person_ids, Array
|
||||||
key :request_ids, Array
|
key :request_ids, Array
|
||||||
|
key :post_ids, Array
|
||||||
|
|
||||||
many :people, :in => :person_ids, :class_name => 'Person'
|
many :people, :in => :person_ids, :class_name => 'Person'
|
||||||
many :requests, :in => :request_ids, :class_name => 'Request'
|
many :requests, :in => :request_ids, :class_name => 'Request'
|
||||||
|
many :posts, :in => :post_ids, :class_name => 'Post'
|
||||||
|
|
||||||
belongs_to :user, :class_name => 'User'
|
belongs_to :user, :class_name => 'User'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,8 @@ class User
|
||||||
person.profile = object
|
person.profile = object
|
||||||
person.save
|
person.save
|
||||||
elsif object.verify_creator_signature == true
|
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
|
object.socket_to_uid( id) if object.respond_to? :socket_to_uid
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,29 @@ describe Diaspora::Parser do
|
||||||
@person = Factory.create(:person_with_private_key, :email => "bill@gates.com")
|
@person = Factory.create(:person_with_private_key, :email => "bill@gates.com")
|
||||||
@user2 = Factory.create(:user)
|
@user2 = Factory.create(:user)
|
||||||
end
|
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
|
describe 'with encryption' do
|
||||||
before do
|
before do
|
||||||
unstub_mocha_stubs
|
unstub_mocha_stubs
|
||||||
|
|
@ -38,7 +61,6 @@ describe Diaspora::Parser do
|
||||||
</XML>"
|
</XML>"
|
||||||
@user.receive xml
|
@user.receive xml
|
||||||
Post.count.should == 0
|
Post.count.should == 0
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue