Skip to content
Extraits de code Groupes Projets
Valider 9e249bb7 rédigé par Maxwell Salzberg's avatar Maxwell Salzberg
Parcourir les fichiers

small refactor of helper method [ci skip]

parent e6b1111f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -47,9 +47,7 @@ end ...@@ -47,9 +47,7 @@ end
#returns the message #returns the message
def legit_post_from_user1_to_user2(user1, user2) def legit_post_from_user1_to_user2(user1, user2)
original_message = user1.post(:status_message, :text => 'store this!', :to => user1.aspects.find_by_name("generic").id) original_message = user1.post(:status_message, :text => 'store this!', :to => user1.aspects.find_by_name("generic").id)
salmon_xml = user1.salmon(original_message).xml_for(user2.person) receive(original_message, :from => user1, :by => user2)
zord = Postzord::Receiver::Private.new(user2, :salmon_xml => salmon_xml)
zord.perform!
original_message original_message
end end
...@@ -59,7 +57,9 @@ describe "attack vectors" do ...@@ -59,7 +57,9 @@ describe "attack vectors" do
let(:alices_aspect) { alice.aspects.find_by_name("generic") } let(:alices_aspect) { alice.aspects.find_by_name("generic") }
context "testing side effects of validation phase" do context "testing side effects of validation phase" do
describe 'Contact Required Unless Request' do describe 'Contact Required Unless Request' do
#CUSTOM SETUP; cant use helpers here
it 'does not save a post from a non-contact as a side effect' do it 'does not save a post from a non-contact as a side effect' do
salmon_xml = nil salmon_xml = nil
bad_post_guid = nil bad_post_guid = nil
...@@ -82,6 +82,8 @@ describe "attack vectors" do ...@@ -82,6 +82,8 @@ describe "attack vectors" do
user_should_not_see_guid(bob, bad_post_guid) user_should_not_see_guid(bob, bad_post_guid)
end end
#CUSTOM SETUP; cant use helpers here
it 'other users can not grant visiblity to another users posts by sending their friends post to themselves (even if they are contacts)' do it 'other users can not grant visiblity to another users posts by sending their friends post to themselves (even if they are contacts)' do
#setup: eve has a message. then, alice is connected to eve. #setup: eve has a message. then, alice is connected to eve.
#(meaning alice can not see the old post, but it exists in the DB) #(meaning alice can not see the old post, but it exists in the DB)
......
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