almost all green
This commit is contained in:
parent
a955dd308e
commit
a068ee532d
4 changed files with 16 additions and 15 deletions
|
|
@ -43,6 +43,7 @@ describe Person do
|
||||||
|
|
||||||
it 'should have a profile in its xml' do
|
it 'should have a profile in its xml' do
|
||||||
@xml.include?("first_name").should == true
|
@xml.include?("first_name").should == true
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -54,7 +55,7 @@ describe Person do
|
||||||
person_two.owns?(person_message).should be false
|
person_two.owns?(person_message).should be false
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should delete all of user except comments upon user deletion' do
|
it 'should delete all of user posts except comments upon user deletion' do
|
||||||
person = Factory.create(:person)
|
person = Factory.create(:person)
|
||||||
|
|
||||||
Factory.create(:status_message, :person => person)
|
Factory.create(:status_message, :person => person)
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ describe Photo do
|
||||||
id = @photo.id
|
id = @photo.id
|
||||||
|
|
||||||
@photo.destroy
|
@photo.destroy
|
||||||
@user.receive xml
|
@user.receive xml, @photo.person
|
||||||
|
|
||||||
new_photo = Photo.first(:id => id)
|
new_photo = Photo.first(:id => id)
|
||||||
new_photo.url.nil?.should be false
|
new_photo.url.nil?.should be false
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,15 @@ describe User do
|
||||||
let!(:second_aspect) { user.aspect(:name => 'losers') }
|
let!(:second_aspect) { user.aspect(:name => 'losers') }
|
||||||
|
|
||||||
let!(:user2) { Factory(:user_with_aspect) }
|
let!(:user2) { Factory(:user_with_aspect) }
|
||||||
|
let!(:user3) { Factory(:user_with_aspect) }
|
||||||
|
let!(:user4) { Factory(:user_with_aspect) }
|
||||||
|
|
||||||
let!(:status_message1) { user2.post :status_message, :message => "hi", :to => user2.aspects.first.id }
|
let!(:status_message1) { user2.post :status_message, :message => "hi", :to => user2.aspects.first.id }
|
||||||
let!(:status_message2) { user2.post :status_message, :message => "hey", :public => true , :to => user2.aspects.first.id }
|
let!(:status_message2) { user2.post :status_message, :message => "hey", :public => true , :to => user2.aspects.first.id }
|
||||||
let!(:status_message3) { user2.post :status_message, :message => "va", :to => user2.aspects.first.id }
|
let!(:status_message3) { user2.post :status_message, :message => "va", :to => user2.aspects.first.id }
|
||||||
let!(:status_message4) { user2.post :status_message, :message => "da", :public => true , :to => user2.aspects.first.id }
|
let!(:status_message4) { user2.post :status_message, :message => "da", :public => true , :to => user2.aspects.first.id }
|
||||||
|
let!(:status_message5) { user3.post :status_message, :message => "heyyyy", :to => user3.aspects.first.id}
|
||||||
|
let!(:status_message6) { user4.post :status_message, :message => "yooo", :to => user4.aspects.first.id}
|
||||||
|
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
|
@ -44,20 +48,15 @@ describe User do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "queries by aspect" do
|
it "queries by aspect" do
|
||||||
user3 = Factory(:user_with_aspect)
|
|
||||||
status_message2 = user3.post :status_message, :message => "heyyyy", :to => user3.aspects.first.id
|
|
||||||
user4 = Factory(:user_with_aspect)
|
|
||||||
status_message3 = user4.post :status_message, :message => "yooo", :to => user4.aspects.first.id
|
|
||||||
|
|
||||||
friend_users(user, second_aspect, user3, user3.aspects.first)
|
friend_users(user, second_aspect, user3, user3.aspects.first)
|
||||||
friend_users(user, second_aspect, user4, user4.aspects.first)
|
friend_users(user, second_aspect, user4, user4.aspects.first)
|
||||||
|
|
||||||
user.receive status_message1.to_diaspora_xml
|
user.receive status_message4.to_diaspora_xml, user2.person
|
||||||
user.receive status_message2.to_diaspora_xml
|
user.receive status_message5.to_diaspora_xml, user3.person
|
||||||
user.receive status_message3.to_diaspora_xml
|
user.receive status_message6.to_diaspora_xml, user4.person
|
||||||
|
|
||||||
user.visible_posts(:by_members_of => first_aspect).should =~ [status_message1]
|
user.visible_posts(:by_members_of => first_aspect).should =~ [status_message4]
|
||||||
user.visible_posts(:by_members_of => second_aspect).should =~ [status_message2, status_message3]
|
user.visible_posts(:by_members_of => second_aspect).should =~ [status_message5, status_message6]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,12 @@ describe 'user encryption' do
|
||||||
|
|
||||||
xml = request.to_diaspora_xml
|
xml = request.to_diaspora_xml
|
||||||
|
|
||||||
remote_user.person.destroy
|
remote_user.person.delete
|
||||||
remote_user.destroy
|
remote_user.delete
|
||||||
|
|
||||||
person_count = Person.all.count
|
person_count = Person.all.count
|
||||||
proc {@user.receive xml}.should_not raise_error /ignature was not valid/
|
@user.receive xml, remote_user.person
|
||||||
|
|
||||||
Person.all.count.should == person_count + 1
|
Person.all.count.should == person_count + 1
|
||||||
new_person = Person.first(:id => id)
|
new_person = Person.first(:id => id)
|
||||||
new_person.exported_key.should == original_key
|
new_person.exported_key.should == original_key
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue