jubjub 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/jubjub/user.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  require 'jubjub/errors'
2
2
  require 'jubjub/jid'
3
3
  require 'jubjub/connection/xmpp_gateway'
4
+ require 'jubjub/pubsub'
5
+ require 'jubjub/muc'
6
+ require 'jubjub/data_form'
4
7
 
5
8
  module Jubjub
6
9
 
@@ -148,6 +148,108 @@ describe Jubjub::Connection::XmppGateway do
148
148
 
149
149
  end
150
150
 
151
+ describe "publish" do
152
+ use_vcr_cassette 'pubsub setup node', :record => :new_episodes
153
+
154
+ before do
155
+ @connection.pubsub.create 'pubsub.theo-template.local', 'node_1'
156
+ end
157
+
158
+ describe "with id" do
159
+ use_vcr_cassette 'pubsub publish with id', :record => :new_episodes
160
+
161
+ it "should return a Jubjub::PubsubItem" do
162
+ i = @connection.pubsub.publish 'pubsub.theo-template.local', 'node_1', Jubjub::DataForm.new, '123'
163
+ i.should be_a_kind_of Jubjub::PubsubItem
164
+ i.item_id.should == '123'
165
+ i.data.should == "<x xmlns=\"jabber:x:data\" type=\"submit\"/>"
166
+ end
167
+
168
+ end
169
+
170
+ describe "with string payload" do
171
+ use_vcr_cassette 'pubsub publish with string payload', :record => :new_episodes
172
+
173
+ it "should return a Jubjub::PubsubItem" do
174
+ item = "<x xmlns=\"jabber:x:data\" type=\"submit\"><field var=\"foo\"><value>true</value></field></x>"
175
+ i = @connection.pubsub.publish 'pubsub.theo-template.local', 'node_1', item
176
+ i.should be_a_kind_of Jubjub::PubsubItem
177
+ i.item_id.should be_a_kind_of String
178
+ i.data.should == "<x xmlns=\"jabber:x:data\" type=\"submit\">\n <field var=\"foo\">\n <value>true</value>\n </field>\n</x>"
179
+ end
180
+
181
+ end
182
+
183
+ describe "with dataform payload" do
184
+ use_vcr_cassette 'pubsub publish with dataform payload', :record => :new_episodes
185
+
186
+ it "should return a Jubjub::PubsubItem" do
187
+ i = @connection.pubsub.publish 'pubsub.theo-template.local', 'node_1', Jubjub::DataForm.new({ :foo => {:type => "boolean", :value => true }})
188
+ i.should be_a_kind_of Jubjub::PubsubItem
189
+ i.item_id.should be_a_kind_of String
190
+ i.data.should == "<x xmlns=\"jabber:x:data\" type=\"submit\">\n <field var=\"foo\">\n <value>true</value>\n </field>\n</x>"
191
+ end
192
+
193
+ end
194
+
195
+ after do
196
+ # Clean up the node
197
+ @connection.pubsub.destroy 'pubsub.theo-template.local', 'node_1'
198
+ end
199
+
200
+ end
201
+
202
+ describe "retract" do
203
+ use_vcr_cassette 'pubsub retract', :record => :new_episodes
204
+
205
+ before do
206
+ @connection.pubsub.create 'pubsub.theo-template.local', 'node_pubsub_retract'
207
+ end
208
+
209
+ it "should return true when successful" do
210
+ item = @connection.pubsub.publish 'pubsub.theo-template.local', 'node_pubsub_retract', Jubjub::DataForm.new()
211
+
212
+ @connection.pubsub.retract( 'pubsub.theo-template.local', 'node_pubsub_retract', item.item_id ).should be_true
213
+ end
214
+
215
+ it "should return false when not successful" do
216
+ @connection.pubsub.retract( 'pubsub.theo-template.local', 'node_pubsub_retract', "wibble" ).should be_false
217
+ end
218
+
219
+ after do
220
+ # Clean up the node
221
+ @connection.pubsub.destroy 'pubsub.theo-template.local', 'node_pubsub_retract'
222
+ end
223
+ end
224
+
225
+ describe "retrieve_items" do
226
+ use_vcr_cassette 'pubsub retrieve items', :record => :new_episodes
227
+
228
+ before do
229
+ @connection.pubsub.create 'pubsub.theo-template.local', 'node_retrieve_items'
230
+ @connection.pubsub.publish 'pubsub.theo-template.local', 'node_retrieve_items', Jubjub::DataForm.new(:bar => {:type => :boolean, :value => true}), 'efg'
231
+ @connection.pubsub.publish 'pubsub.theo-template.local', 'node_retrieve_items', Jubjub::DataForm.new(:foo => {:type => :boolean, :value => false}), 'abc'
232
+ end
233
+
234
+ it "should return array of PubsubItem when successful" do
235
+ expected = [
236
+ Jubjub::PubsubItem.new( 'pubsub.theo-template.local', 'node_retrieve_items', 'abc', "<x xmlns=\"jabber:x:data\" type=\"submit\">\n <field var=\"foo\">\n <value>false</value>\n </field>\n </x>", @connection ),
237
+ Jubjub::PubsubItem.new( 'pubsub.theo-template.local', 'node_retrieve_items', 'efg', "<x xmlns=\"jabber:x:data\" type=\"submit\">\n <field var=\"bar\">\n <value>true</value>\n </field>\n </x>", @connection )
238
+ ]
239
+
240
+ @connection.pubsub.retrieve_items( 'pubsub.theo-template.local', 'node_retrieve_items' ).should == expected
241
+ end
242
+
243
+ it "should return empty array when not successful" do
244
+ @connection.pubsub.retrieve_items( 'pubsub.theo-template.local', 'node_retrieve_items_wibble' ).should == []
245
+ end
246
+
247
+ after do
248
+ # Clean up the node
249
+ @connection.pubsub.destroy 'pubsub.theo-template.local', 'node_retrieve_items'
250
+ end
251
+ end
252
+
151
253
  end
152
254
 
153
255
  end
@@ -0,0 +1,28 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3cpublish%20node%3d%22node_1%22%3e%0a%20%20%20%20%20%20%3citem%3e%0a%20%20%20%20%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%3e%0a%20%20%20%20%20%20%20%20%20%20%3cfield%20var%3d%22foo%22%3e%0a%20%20%20%20%20%20%20%20%20%20%20%20%3cvalue%3etrue%3c%2fvalue%3e%0a%20%20%20%20%20%20%20%20%20%20%3c%2ffield%3e%0a%20%20%20%20%20%20%20%20%3c%2fx%3e%0a%20%20%20%20%20%20%3c%2fitem%3e%0a%20%20%20%20%3c%2fpublish%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "280"
19
+ body: |
20
+ <iq type="result" id="blather004d" to="theozaurus@theo-template.local/39957870571305901244463676" from="pubsub.theo-template.local">
21
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
22
+ <publish node="node_1">
23
+ <item id="519DC0A278204"/>
24
+ </publish>
25
+ </pubsub>
26
+ </iq>
27
+
28
+ http_version: "1.1"
@@ -0,0 +1,28 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3cpublish%20node%3d%22node_1%22%3e%0a%20%20%20%20%20%20%3citem%20id%3d%22123%22%3e%0a%20%20%20%20%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%2f%3e%0a%20%20%20%20%20%20%3c%2fitem%3e%0a%20%20%20%20%3c%2fpublish%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "270"
19
+ body: |
20
+ <iq type="result" id="blather0047" to="theozaurus@theo-template.local/39957870571305901244463676" from="pubsub.theo-template.local">
21
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
22
+ <publish node="node_1">
23
+ <item id="123"/>
24
+ </publish>
25
+ </pubsub>
26
+ </iq>
27
+
28
+ http_version: "1.1"
@@ -0,0 +1,28 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3cpublish%20node%3d%22node_1%22%3e%0a%20%20%20%20%20%20%3citem%3e%0a%20%20%20%20%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%3e%0a%20%20%20%20%20%20%20%20%20%20%3cfield%20var%3d%22foo%22%3e%0a%20%20%20%20%20%20%20%20%20%20%20%20%3cvalue%3etrue%3c%2fvalue%3e%0a%20%20%20%20%20%20%20%20%20%20%3c%2ffield%3e%0a%20%20%20%20%20%20%20%20%3c%2fx%3e%0a%20%20%20%20%20%20%3c%2fitem%3e%0a%20%20%20%20%3c%2fpublish%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "280"
19
+ body: |
20
+ <iq type="result" id="blather004b" to="theozaurus@theo-template.local/39957870571305901244463676" from="pubsub.theo-template.local">
21
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
22
+ <publish node="node_1">
23
+ <item id="519DC0A24125B"/>
24
+ </publish>
25
+ </pubsub>
26
+ </iq>
27
+
28
+ http_version: "1.1"
@@ -0,0 +1,122 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3ccreate%20node%3d%22node_pubsub_retract%22%2f%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "245"
19
+ body: |
20
+ <iq type="result" id="blather008b" from="pubsub.theo-template.local" to="theozaurus@theo-template.local/38993116001306144742270559">
21
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
22
+ <create node="node_pubsub_retract"/>
23
+ </pubsub>
24
+ </iq>
25
+
26
+ http_version: "1.1"
27
+ - !ruby/struct:VCR::HTTPInteraction
28
+ request: !ruby/struct:VCR::Request
29
+ method: :post
30
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
31
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3cpublish%20node%3d%22node_pubsub_retract%22%3e%0a%20%20%20%20%20%20%3citem%3e%0a%20%20%20%20%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%2f%3e%0a%20%20%20%20%20%20%3c%2fitem%3e%0a%20%20%20%20%3c%2fpublish%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
32
+ headers:
33
+ content-type:
34
+ - application/x-www-form-urlencoded
35
+ response: !ruby/struct:VCR::Response
36
+ status: !ruby/struct:VCR::ResponseStatus
37
+ code: 200
38
+ message: ...
39
+ headers:
40
+ content-type:
41
+ - application/xml
42
+ content-length:
43
+ - "293"
44
+ body: |
45
+ <iq type="result" id="blather008d" to="theozaurus@theo-template.local/38993116001306144742270559" from="pubsub.theo-template.local">
46
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
47
+ <publish node="node_pubsub_retract">
48
+ <item id="51A2356647606"/>
49
+ </publish>
50
+ </pubsub>
51
+ </iq>
52
+
53
+ http_version: "1.1"
54
+ - !ruby/struct:VCR::HTTPInteraction
55
+ request: !ruby/struct:VCR::Request
56
+ method: :post
57
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
58
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3cretract%20node%3d%22node_pubsub_retract%22%3e%0a%20%20%20%20%20%20%3citem%20id%3d%2251A2356647606%22%2f%3e%0a%20%20%20%20%3c%2fretract%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
59
+ headers:
60
+ content-type:
61
+ - application/x-www-form-urlencoded
62
+ response: !ruby/struct:VCR::Response
63
+ status: !ruby/struct:VCR::ResponseStatus
64
+ code: 200
65
+ message: ...
66
+ headers:
67
+ content-type:
68
+ - application/xml
69
+ content-length:
70
+ - "134"
71
+ body: |
72
+ <iq type="result" id="blather008f" from="pubsub.theo-template.local" to="theozaurus@theo-template.local/38993116001306144742270559"/>
73
+
74
+ http_version: "1.1"
75
+ - !ruby/struct:VCR::HTTPInteraction
76
+ request: !ruby/struct:VCR::Request
77
+ method: :post
78
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
79
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%23owner%22%3e%0a%20%20%20%20%3cdelete%20node%3d%22node_pubsub_retract%22%2f%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
80
+ headers:
81
+ content-type:
82
+ - application/x-www-form-urlencoded
83
+ response: !ruby/struct:VCR::Response
84
+ status: !ruby/struct:VCR::ResponseStatus
85
+ code: 200
86
+ message: ...
87
+ headers:
88
+ content-type:
89
+ - application/xml
90
+ content-length:
91
+ - "134"
92
+ body: |
93
+ <iq type="result" id="blather0091" from="pubsub.theo-template.local" to="theozaurus@theo-template.local/38993116001306144742270559"/>
94
+
95
+ http_version: "1.1"
96
+ - !ruby/struct:VCR::HTTPInteraction
97
+ request: !ruby/struct:VCR::Request
98
+ method: :post
99
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
100
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3cretract%20node%3d%22node_pubsub_retract%22%3e%0a%20%20%20%20%20%20%3citem%20id%3d%22wibble%22%2f%3e%0a%20%20%20%20%3c%2fretract%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
101
+ headers:
102
+ content-type:
103
+ - application/x-www-form-urlencoded
104
+ response: !ruby/struct:VCR::Response
105
+ status: !ruby/struct:VCR::ResponseStatus
106
+ code: 200
107
+ message: ...
108
+ headers:
109
+ content-type:
110
+ - application/xml
111
+ content-length:
112
+ - "396"
113
+ body: |
114
+ <iq type="error" id="blather0093" to="theozaurus@theo-template.local/38993116001306144742270559" from="pubsub.theo-template.local" lang="en">
115
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
116
+ <retract node="node_pubsub_retract">
117
+ <item id="wibble"/>
118
+ </retract>
119
+ </pubsub>
120
+ <error code="404" type="cancel"><item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
121
+
122
+ http_version: "1.1"
@@ -0,0 +1,166 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
6
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3ccreate%20node%3d%22node_retrieve_items%22%2f%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: ...
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ content-length:
18
+ - "245"
19
+ body: |
20
+ <iq type="result" id="blather006b" from="pubsub.theo-template.local" to="theozaurus@theo-template.local/26631567861306144312811586">
21
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
22
+ <create node="node_retrieve_items"/>
23
+ </pubsub>
24
+ </iq>
25
+
26
+ http_version: "1.1"
27
+ - !ruby/struct:VCR::HTTPInteraction
28
+ request: !ruby/struct:VCR::Request
29
+ method: :post
30
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
31
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3cpublish%20node%3d%22node_retrieve_items%22%3e%0a%20%20%20%20%20%20%3citem%20id%3d%22efg%22%3e%0a%20%20%20%20%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%3e%0a%20%20%20%20%20%20%20%20%20%20%3cfield%20var%3d%22bar%22%3e%0a%20%20%20%20%20%20%20%20%20%20%20%20%3cvalue%3etrue%3c%2fvalue%3e%0a%20%20%20%20%20%20%20%20%20%20%3c%2ffield%3e%0a%20%20%20%20%20%20%20%20%3c%2fx%3e%0a%20%20%20%20%20%20%3c%2fitem%3e%0a%20%20%20%20%3c%2fpublish%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
32
+ headers:
33
+ content-type:
34
+ - application/x-www-form-urlencoded
35
+ response: !ruby/struct:VCR::Response
36
+ status: !ruby/struct:VCR::ResponseStatus
37
+ code: 200
38
+ message: ...
39
+ headers:
40
+ content-type:
41
+ - application/xml
42
+ content-length:
43
+ - "283"
44
+ body: |
45
+ <iq type="result" id="blather006d" to="theozaurus@theo-template.local/26631567861306144312811586" from="pubsub.theo-template.local">
46
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
47
+ <publish node="node_retrieve_items">
48
+ <item id="efg"/>
49
+ </publish>
50
+ </pubsub>
51
+ </iq>
52
+
53
+ http_version: "1.1"
54
+ - !ruby/struct:VCR::HTTPInteraction
55
+ request: !ruby/struct:VCR::Request
56
+ method: :post
57
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
58
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3cpublish%20node%3d%22node_retrieve_items%22%3e%0a%20%20%20%20%20%20%3citem%20id%3d%22abc%22%3e%0a%20%20%20%20%20%20%20%20%3cx%20xmlns%3d%22jabber%3ax%3adata%22%20type%3d%22submit%22%3e%0a%20%20%20%20%20%20%20%20%20%20%3cfield%20var%3d%22foo%22%3e%0a%20%20%20%20%20%20%20%20%20%20%20%20%3cvalue%3efalse%3c%2fvalue%3e%0a%20%20%20%20%20%20%20%20%20%20%3c%2ffield%3e%0a%20%20%20%20%20%20%20%20%3c%2fx%3e%0a%20%20%20%20%20%20%3c%2fitem%3e%0a%20%20%20%20%3c%2fpublish%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
59
+ headers:
60
+ content-type:
61
+ - application/x-www-form-urlencoded
62
+ response: !ruby/struct:VCR::Response
63
+ status: !ruby/struct:VCR::ResponseStatus
64
+ code: 200
65
+ message: ...
66
+ headers:
67
+ content-type:
68
+ - application/xml
69
+ content-length:
70
+ - "283"
71
+ body: |
72
+ <iq type="result" id="blather006f" to="theozaurus@theo-template.local/26631567861306144312811586" from="pubsub.theo-template.local">
73
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
74
+ <publish node="node_retrieve_items">
75
+ <item id="abc"/>
76
+ </publish>
77
+ </pubsub>
78
+ </iq>
79
+
80
+ http_version: "1.1"
81
+ - !ruby/struct:VCR::HTTPInteraction
82
+ request: !ruby/struct:VCR::Request
83
+ method: :post
84
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
85
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22get%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3citems%20node%3d%22node_retrieve_items%22%2f%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
86
+ headers:
87
+ content-type:
88
+ - application/x-www-form-urlencoded
89
+ response: !ruby/struct:VCR::Response
90
+ status: !ruby/struct:VCR::ResponseStatus
91
+ code: 200
92
+ message: ...
93
+ headers:
94
+ content-type:
95
+ - application/xml
96
+ content-length:
97
+ - "609"
98
+ body: |
99
+ <iq type="result" id="blather0071" from="pubsub.theo-template.local" to="theozaurus@theo-template.local/26631567861306144312811586">
100
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
101
+ <items node="node_retrieve_items">
102
+ <item id="abc">
103
+ <x xmlns="jabber:x:data" type="submit">
104
+ <field var="foo">
105
+ <value>false</value>
106
+ </field>
107
+ </x>
108
+ </item>
109
+ <item id="efg">
110
+ <x xmlns="jabber:x:data" type="submit">
111
+ <field var="bar">
112
+ <value>true</value>
113
+ </field>
114
+ </x>
115
+ </item>
116
+ </items>
117
+ </pubsub>
118
+ </iq>
119
+
120
+ http_version: "1.1"
121
+ - !ruby/struct:VCR::HTTPInteraction
122
+ request: !ruby/struct:VCR::Request
123
+ method: :post
124
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
125
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22set%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%23owner%22%3e%0a%20%20%20%20%3cdelete%20node%3d%22node_retrieve_items%22%2f%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
126
+ headers:
127
+ content-type:
128
+ - application/x-www-form-urlencoded
129
+ response: !ruby/struct:VCR::Response
130
+ status: !ruby/struct:VCR::ResponseStatus
131
+ code: 200
132
+ message: ...
133
+ headers:
134
+ content-type:
135
+ - application/xml
136
+ content-length:
137
+ - "134"
138
+ body: |
139
+ <iq type="result" id="blather0073" from="pubsub.theo-template.local" to="theozaurus@theo-template.local/26631567861306144312811586"/>
140
+
141
+ http_version: "1.1"
142
+ - !ruby/struct:VCR::HTTPInteraction
143
+ request: !ruby/struct:VCR::Request
144
+ method: :post
145
+ uri: http://theozaurus%40theo-template.local:secret@127.0.0.1:8000/
146
+ body: stanza=%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3ciq%20type%3d%22get%22%20to%3d%22pubsub.theo-template.local%22%3e%0a%20%20%3cpubsub%20xmlns%3d%22http%3a%2f%2fjabber.org%2fprotocol%2fpubsub%22%3e%0a%20%20%20%20%3citems%20node%3d%22node_retrieve_items_wibble%22%2f%3e%0a%20%20%3c%2fpubsub%3e%0a%3c%2fiq%3e%0a
147
+ headers:
148
+ content-type:
149
+ - application/x-www-form-urlencoded
150
+ response: !ruby/struct:VCR::Response
151
+ status: !ruby/struct:VCR::ResponseStatus
152
+ code: 200
153
+ message: ...
154
+ headers:
155
+ content-type:
156
+ - application/xml
157
+ content-length:
158
+ - "361"
159
+ body: |
160
+ <iq type="error" id="blather0075" from="pubsub.theo-template.local" to="theozaurus@theo-template.local/26631567861306144312811586" lang="en">
161
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
162
+ <items node="node_retrieve_items_wibble"/>
163
+ </pubsub>
164
+ <error code="404" type="cancel"><item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
165
+
166
+ http_version: "1.1"