spec/blather/stanza/pubsub/subscriptions_spec.rb in blather-1.0.0 vs spec/blather/stanza/pubsub/subscriptions_spec.rb in blather-1.1.0
- old
+ new
@@ -29,9 +29,18 @@
subscriptions.subscriptions.should_not be_nil
subscriptions.find('//ns:pubsub/ns:subscriptions', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty
end
+ it 'ensures the subscriptions node is not duplicated when calling #subscriptions' do
+ subscriptions = Blather::Stanza::PubSub::Subscriptions.new
+ subscriptions.pubsub.remove_children :subscriptions
+ subscriptions.find('//ns:pubsub/ns:subscriptions', :ns => Blather::Stanza::PubSub.registered_ns).should be_empty
+
+ 5.times { subscriptions.subscriptions }
+ subscriptions.find('//ns:pubsub/ns:subscriptions', :ns => Blather::Stanza::PubSub.registered_ns).count.should eq(1)
+ end
+
it 'defaults to a get node' do
aff = Blather::Stanza::PubSub::Subscriptions.new
aff.type.should == :get
end