@@ -155,83 +155,6 @@ describe('UNIT Message', function () {
155155 it . skip ( 'should do something if not called properly' ) ;
156156 } ) ;
157157
158- describe ( 'addDataWithKeyValue()' , function ( ) {
159- it ( 'should add properties to the message data object given a key and value' , function ( ) {
160- var mess = new Message ( ) ;
161- mess . addDataWithKeyValue ( 'myKey' , 'Message' ) ;
162-
163- var json = mess . toJson ( ) ;
164-
165- expect ( json . data . myKey ) . to . equal ( 'Message' ) ;
166- } ) ;
167-
168- it ( 'should only set values on data object, not top level message' , function ( ) {
169- var mess = new Message ( ) ;
170- mess . addDataWithKeyValue ( 'collapseKey' , 'Message' ) ;
171-
172- var json = mess . toJson ( ) ;
173-
174- expect ( json . collapse_key ) . to . not . equal ( 'Message' ) ;
175- expect ( json . data . collapseKey ) . to . equal ( 'Message' ) ;
176- } ) ;
177-
178- it . skip ( 'should do something if not called properly' ) ;
179- } ) ;
180-
181- describe ( 'addDataWithObject()' , function ( ) {
182- it ( 'should set the data property to the object passed in' , function ( ) {
183- var mess = new Message ( ) ;
184- var obj = {
185- message : 'hello' ,
186- key : 'value'
187- } ;
188- mess . addDataWithObject ( obj ) ;
189-
190- var json = mess . toJson ( ) ;
191-
192- expect ( json . data ) . to . deep . equal ( obj ) ;
193- } ) ;
194-
195- it ( 'should overwrite data object when an object is passed in' , function ( ) {
196- var data = {
197- message : 'hello' ,
198- key : 'value'
199- } ;
200- var mess = new Message ( { data : { message : 'bye' , prop : 'none' } } ) ;
201- mess . addDataWithObject ( data ) ;
202-
203- var json = mess . toJson ( ) ;
204-
205- expect ( json . data ) . to . deep . equal ( data ) ;
206- } ) ;
207-
208- it ( 'should not overwrite data if not passed an object' , function ( ) {
209- var data = {
210- message : 'hello' ,
211- key : 'value'
212- } ;
213- var mess = new Message ( { data : data } ) ;
214- mess . addDataWithObject ( 'adding' ) ;
215-
216- var json = mess . toJson ( ) ;
217-
218- expect ( json . data ) . to . deep . equal ( data ) ;
219- } ) ;
220-
221- it ( 'should not overwrite data if passed an empty object' , function ( ) {
222- var data = {
223- message : 'hello' ,
224- key : 'value'
225- } ;
226- var mess = new Message ( { data : data } ) ;
227- mess . addDataWithObject ( { } ) ;
228-
229- var json = mess . toJson ( ) ;
230-
231- expect ( json . data ) . to . deep . equal ( data ) ;
232- } ) ;
233- } ) ;
234-
235158 describe ( 'addNotification()' , function ( ) {
236159 it ( 'should add attribute on notification object if pass key and value' , function ( ) {
237160 var mess = new Message ( ) ;
@@ -260,7 +183,7 @@ describe('UNIT Message', function () {
260183 expect ( json . notification ) . to . deep . equal ( obj ) ;
261184 } ) ;
262185 } ) ;
263-
186+
264187 describe ( 'toJson()' , function ( ) {
265188 it ( 'should return well-formed data for GCM if it is valid' , function ( ) {
266189 var m = new Message ( {
@@ -279,7 +202,7 @@ describe('UNIT Message', function () {
279202 expect ( json . delayWhileIdle ) . to . be . an ( "undefined" ) ;
280203 expect ( json . dryRun ) . to . be . an ( "undefined" ) ;
281204 } ) ;
282-
205+
283206 it ( 'should return well-formed data for GCM if it describes a notification' , function ( ) {
284207 var notificationData = {
285208 title : "Hello, World" ,
@@ -296,7 +219,7 @@ describe('UNIT Message', function () {
296219 expect ( json . notification ) . not . to . be . an ( "undefined" ) ;
297220 expect ( json . notification ) . to . deep . equal ( notificationData ) ;
298221 } ) ;
299-
222+
300223 it ( 'should ignore non-standard fields when serializing' , function ( ) {
301224 var m = new Message ( {
302225 timeToLive : 60 * 60 * 24 ,
0 commit comments