Sha256: 1627148dd0bb84d6c1adf8605923725b260754ae68aa1c3e5143e997ac2c835b

Contents?: true

Size: 1.03 KB

Versions: 22

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'
require 'fixtures/pubsub'

describe Blather::Stanza::PubSubOwner do
  it 'registers itself' do
    Blather::XMPPNode.class_from_registration(:pubsub, 'http://jabber.org/protocol/pubsub#owner').should == 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).should_not 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).should be_nil

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

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

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
blather-1.2.0 spec/blather/stanza/pubsub_owner_spec.rb
blather-1.1.4 spec/blather/stanza/pubsub_owner_spec.rb
blather-1.1.3 spec/blather/stanza/pubsub_owner_spec.rb
blather-1.1.2 spec/blather/stanza/pubsub_owner_spec.rb
blather-1.1.1 spec/blather/stanza/pubsub_owner_spec.rb
blather-1.1.0 spec/blather/stanza/pubsub_owner_spec.rb
blather-1.0.0 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.8 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.7 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.6 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.5 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.4 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.3 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.2 spec/blather/stanza/pubsub_owner_spec.rb
tp-blather-0.8.5 spec/blather/stanza/pubsub_owner_spec.rb
tp-blather-0.8.4 spec/blather/stanza/pubsub_owner_spec.rb
tp-blather-0.8.3 spec/blather/stanza/pubsub_owner_spec.rb
tp-blather-0.8.2 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.1 spec/blather/stanza/pubsub_owner_spec.rb
blather-0.8.0 spec/blather/stanza/pubsub_owner_spec.rb