Sha256: e9c2ea03d947c265a29851ade46828b9fd27158f589216bf66fa7339b171e61c

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'
require 'fixtures/pubsub'

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

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

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

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blather-2.0.0 spec/blather/stanza/pubsub_owner_spec.rb