25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/vendor/xmpp4r/test/pubsub/tc_subscriptionconfig.rb', line 25
def test_create_with_options
node = 'mynode'
jid = '[email protected]'
options = {'pubsub#access_model'=>'open'}
subid = '004-yyy'
config = PubSub::SubscriptionConfig.new(node, jid, options, subid)
assert_equal(node, config.node)
assert_equal(subid, config.subid)
assert_kind_of(Jabber::JID, config.jid)
assert_equal(Jabber::JID.new(jid), config.jid)
assert_kind_of(Jabber::Dataforms::XData, config.form)
assert_equal(options, config.options)
assert_equal(:submit, config.form.type)
assert_equal('http://jabber.org/protocol/pubsub#subscribe_options', config.form.field('FORM_TYPE').values.first)
end
|