@@ -19,6 +19,7 @@ var count = 0;
19
19
20
20
var message_string = "Hi from Javascript" ;
21
21
var message_jsono = { "message" : "Hi from Javascript" } ;
22
+ var message_jsono_q = { "message" : "How are you ?" } ;
22
23
var message_jsona = [ "message" , "Hi from javascript" ] ;
23
24
var message_num = 123 ;
24
25
var message_num_str = "123" ;
@@ -146,6 +147,42 @@ describe('Pubnub', function() {
146
147
147
148
} )
148
149
} )
150
+ it ( 'should publish json objects without error ( with ? in content ) ' , function ( done ) {
151
+ var ch = channel + '-' + ++ count ;
152
+ pubnub . subscribe ( { channel : ch ,
153
+ connect : function ( response ) {
154
+ pubnub . publish ( { channel : ch , message : message_jsono_q ,
155
+ callback : function ( response ) {
156
+ assert . deepEqual ( response [ 0 ] , 1 ) ;
157
+ }
158
+ } ) ;
159
+ } ,
160
+ callback : function ( response ) {
161
+ assert . deepEqual ( response , message_jsono_q ) ;
162
+ pubnub . unsubscribe ( { channel : ch } ) ;
163
+ done ( ) ;
164
+ }
165
+
166
+ } )
167
+ } )
168
+ it ( 'should publish json objects without error when encryption is enabled ( with ? in content )' , function ( done ) {
169
+ var ch = channel + '-' + ++ count ;
170
+ pubnub_enc . subscribe ( { channel : ch ,
171
+ connect : function ( response ) {
172
+ pubnub_enc . publish ( { channel : ch , message : message_jsono_q ,
173
+ callback : function ( response ) {
174
+ assert . deepEqual ( response [ 0 ] , 1 ) ;
175
+ }
176
+ } ) ;
177
+ } ,
178
+ callback : function ( response ) {
179
+ assert . deepEqual ( response , message_jsono_q ) ;
180
+ pubnub_enc . unsubscribe ( { channel : ch } ) ;
181
+ done ( ) ;
182
+ }
183
+
184
+ } )
185
+ } )
149
186
it ( 'should publish json arrays without error' , function ( done ) {
150
187
var ch = channel + '-' + ++ count ;
151
188
pubnub . subscribe ( { channel : ch ,
0 commit comments