Skip to content
Extraits de code Groupes Projets
Valider e6e15483 rédigé par Ilya Zhitomirskiy's avatar Ilya Zhitomirskiy
Parcourir les fichiers

more verbose testing of grouped_people

parent 17b5e7b0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -6,19 +6,19 @@ require 'hydra_wrapper' ...@@ -6,19 +6,19 @@ require 'hydra_wrapper'
describe HydraWrapper do describe HydraWrapper do
before do before do
@wrapper = HydraWrapper.new(stub, [stub, stub, stub], "<encoded_xml>", stub) @people = ["person", "person2", "person3"]
@wrapper = HydraWrapper.new(stub, @people, "<encoded_xml>", stub)
end end
describe 'initialize' do describe 'initialize' do
it 'it sets the proper instance variables' do it 'it sets the proper instance variables' do
user = "user" user = "user"
people = ["person"]
encoded_object_xml = "encoded xml" encoded_object_xml = "encoded xml"
dispatcher_class = "Postzord::Dispatcher::Private" dispatcher_class = "Postzord::Dispatcher::Private"
wrapper = HydraWrapper.new(user, people, encoded_object_xml, dispatcher_class) wrapper = HydraWrapper.new(user, @people, encoded_object_xml, dispatcher_class)
wrapper.user.should == user wrapper.user.should == user
wrapper.people.should == people wrapper.people.should == @people
wrapper.encoded_object_xml.should == encoded_object_xml wrapper.encoded_object_xml.should == encoded_object_xml
end end
end end
...@@ -43,10 +43,9 @@ describe HydraWrapper do ...@@ -43,10 +43,9 @@ describe HydraWrapper do
describe '#grouped_people' do describe '#grouped_people' do
it 'groups people given their receive_urls' do it 'groups people given their receive_urls' do
@wrapper.people.each do |person| @wrapper.dispatcher_class.should_receive(:receive_url_for).and_return("foo.com","bar.com","bar.com")
@wrapper.dispatcher_class.should_receive(:receive_url_for).with(person).and_return("foo.com")
end @wrapper.grouped_people.should == {"foo.com" => [@people[0]], "bar.com" => @people[1,2]}
@wrapper.grouped_people.should == {"foo.com" => @wrapper.people}
end end
end end
......
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