Sha256: 5821c4af0fcfffb21b416dc9ebdb3dbd1ec9a2d5c64da7792be6dba97ba35a65

Contents?: true

Size: 1.09 KB

Versions: 22

Compression:

Stored size: 1.09 KB

Contents

require File.join(File.dirname(__FILE__), *%w[.. .. spec_helper])
require File.join(File.dirname(__FILE__), *%w[.. .. fixtures pubsub])

describe Blather::Stanza::PubSubOwner do
  it 'registers itself' do
    Blather::XMPPNode.class_from_registration(:pubsub, 'http://jabber.org/protocol/pubsub#owner').must_equal Blather::Stanza::PubSubOwner
  end

  it 'ensures a pubusb node is present on create' do
    pubsub = Blather::Stanza::PubSubOwner.new
    pubsub.find_first('/iq/ns:pubsub', :ns => Blather::Stanza::PubSubOwner.registered_ns).wont_be_nil
  end

  it 'ensures a pubsub node exists when calling #pubsub' do
    pubsub = Blather::Stanza::PubSubOwner.new
    pubsub.remove_children :pubsub
    pubsub.find_first('/iq/ns:pubsub', :ns => Blather::Stanza::PubSubOwner.registered_ns).must_be_nil

    pubsub.pubsub.wont_be_nil
    pubsub.find_first('/iq/ns:pubsub', :ns => Blather::Stanza::PubSubOwner.registered_ns).wont_be_nil
  end

  it 'sets the host if requested' do
    aff = Blather::Stanza::PubSubOwner.new :get, 'pubsub.jabber.local'
    aff.to.must_equal Blather::JID.new('pubsub.jabber.local')
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
sprsquish-blather-0.4.0 spec/blather/stanza/pubsub_owner_spec.rb
sprsquish-blather-0.4.1 spec/blather/stanza/pubsub_owner_spec.rb
sprsquish-blather-0.4.2 spec/blather/stanza/pubsub_owner_spec.rb
sprsquish-blather-0.4.3 spec/blather/stanza/pubsub_owner_spec.rb
sprsquish-blather-0.4.4 spec/blather/stanza/pubsub_owner_spec.rb
shingara-blather-0.4.14 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.14 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.13 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.12 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.11 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.10 spec/blather/stanza/pubsub_owner_spec.rb
shingara-blather-0.4.9 spec/blather/stanza/pubsub_owner_spec.rb
shingara-blather-0.4.8 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.8 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.7 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.6 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.5 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.4 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.3 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.4.1 spec/blather/stanza/pubsub_owner_spec.rb