@@ -327,7 +327,6 @@ describe('globals', function() {
327
327
Raven . debug = true ;
328
328
this . sinon . stub ( console , level ) ;
329
329
logDebug ( level , message , { } , 'foo' ) ;
330
- assert . isTrue ( console [ level ] . calledOnce ) ;
331
330
} ) ;
332
331
} ) ;
333
332
@@ -825,15 +824,6 @@ describe('globals', function() {
825
824
} ) ;
826
825
827
826
describe ( 'send' , function ( ) {
828
- it ( 'should check `isSetup`' , function ( ) {
829
- this . sinon . stub ( window , 'isSetup' ) . returns ( false ) ;
830
- this . sinon . stub ( window , 'makeRequest' ) ;
831
-
832
- send ( ) ;
833
- assert . isTrue ( window . isSetup . calledOnce ) ;
834
- assert . isFalse ( window . makeRequest . calledOnce ) ;
835
- } ) ;
836
-
837
827
it ( 'should build a good data payload' , function ( ) {
838
828
this . sinon . stub ( window , 'isSetup' ) . returns ( true ) ;
839
829
this . sinon . stub ( window , 'makeRequest' ) ;
@@ -1086,20 +1076,6 @@ describe('globals', function() {
1086
1076
extra : { 'session:duration' : 100 }
1087
1077
} ) ;
1088
1078
} ) ;
1089
-
1090
- it ( 'should log to console if not configured' , function ( ) {
1091
- this . sinon . stub ( window , 'isSetup' ) . returns ( false ) ;
1092
- this . sinon . stub ( console , 'log' ) ;
1093
- send ( { foo : 'bar' } ) ;
1094
- assert . isTrue ( console . log . called ) ;
1095
- } ) ;
1096
-
1097
- it ( 'should NOT log to console if configured' , function ( ) {
1098
- this . sinon . stub ( window , 'isSetup' ) . returns ( true ) ;
1099
- this . sinon . stub ( console , 'log' ) ;
1100
- send ( { foo : 'bar' } ) ;
1101
- assert . isFalse ( console . log . called ) ;
1102
- } ) ;
1103
1079
} ) ;
1104
1080
1105
1081
describe ( 'makeRequest' , function ( ) {
@@ -1110,6 +1086,25 @@ describe('globals', function() {
1110
1086
this . sinon . stub ( window , 'newImage' , function ( ) { var img = { } ; imageCache . push ( img ) ; return img ; } ) ;
1111
1087
} )
1112
1088
1089
+ it ( 'should check `isSetup`' , function ( ) {
1090
+ this . sinon . stub ( window , 'isSetup' ) . returns ( false ) ;
1091
+ makeRequest ( { foo : 'bar' } ) ;
1092
+ assert . isTrue ( window . isSetup . called ) ;
1093
+ } ) ;
1094
+
1095
+ it ( 'should not create the image if `isSetup` is false' , function ( ) {
1096
+ this . sinon . stub ( window , 'isSetup' ) . returns ( false ) ;
1097
+ makeRequest ( { foo : 'bar' } ) ;
1098
+ assert . isFalse ( window . newImage . called ) ;
1099
+ } ) ;
1100
+
1101
+ it ( 'should log to console' , function ( ) {
1102
+ this . sinon . stub ( window , 'isSetup' ) . returns ( true ) ;
1103
+ this . sinon . stub ( window , 'logDebug' ) ;
1104
+ makeRequest ( { foo : 'bar' } ) ;
1105
+ assert . isTrue ( window . logDebug . called ) ;
1106
+ } ) ;
1107
+
1113
1108
it ( 'should load an Image' , function ( ) {
1114
1109
authQueryString = '?lol' ;
1115
1110
globalServer = 'http://localhost/' ;
0 commit comments