File tree 7 files changed +29
-10
lines changed
7 files changed +29
-10
lines changed Original file line number Diff line number Diff line change
1
+ v2.0.1
2
+ Thu, 12 Jun 2014 05:19:23 GMT
3
+
4
+ 0e83953 [changed] don’t require textStatus
5
+ 46440df [fixed] let jqXHR object survive the fixture copy
6
+
7
+
1
8
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ic-ajax" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"authors" : [
5
5
" Ryan Florence <[email protected] >"
6
6
],
Original file line number Diff line number Diff line change @@ -56,7 +56,10 @@ define(
56
56
*/
57
57
58
58
function defineFixture ( url , fixture ) {
59
- __fixtures__ [ url ] = JSON . parse ( JSON . stringify ( fixture ) ) ;
59
+ if ( fixture . response ) {
60
+ fixture . response = JSON . parse ( JSON . stringify ( fixture . response ) ) ;
61
+ }
62
+ __fixtures__ [ url ] = fixture ;
60
63
}
61
64
62
65
__exports__ . defineFixture = defineFixture ; /*
@@ -73,7 +76,7 @@ define(
73
76
return new Ember . RSVP . Promise ( function ( resolve , reject ) {
74
77
var fixture = lookupFixture ( settings . url ) ;
75
78
if ( fixture ) {
76
- if ( fixture . textStatus === 'success' ) {
79
+ if ( fixture . textStatus === 'success' || fixture . textStatus == null ) {
77
80
return Ember . run ( null , resolve , fixture ) ;
78
81
} else {
79
82
return Ember . run ( null , reject , fixture ) ;
Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ exports.__fixtures__ = __fixtures__;
53
53
*/
54
54
55
55
function defineFixture ( url , fixture ) {
56
- __fixtures__ [ url ] = JSON . parse ( JSON . stringify ( fixture ) ) ;
56
+ if ( fixture . response ) {
57
+ fixture . response = JSON . parse ( JSON . stringify ( fixture . response ) ) ;
58
+ }
59
+ __fixtures__ [ url ] = fixture ;
57
60
}
58
61
59
62
exports . defineFixture = defineFixture ; /*
@@ -70,7 +73,7 @@ exports.lookupFixture = lookupFixture;function makePromise(settings) {
70
73
return new Ember . RSVP . Promise ( function ( resolve , reject ) {
71
74
var fixture = lookupFixture ( settings . url ) ;
72
75
if ( fixture ) {
73
- if ( fixture . textStatus === 'success' ) {
76
+ if ( fixture . textStatus === 'success' || fixture . textStatus == null ) {
74
77
return Ember . run ( null , resolve , fixture ) ;
75
78
} else {
76
79
return Ember . run ( null , reject , fixture ) ;
Original file line number Diff line number Diff line change @@ -54,7 +54,10 @@ exports.__fixtures__ = __fixtures__;
54
54
*/
55
55
56
56
function defineFixture ( url , fixture ) {
57
- __fixtures__ [ url ] = JSON . parse ( JSON . stringify ( fixture ) ) ;
57
+ if ( fixture . response ) {
58
+ fixture . response = JSON . parse ( JSON . stringify ( fixture . response ) ) ;
59
+ }
60
+ __fixtures__ [ url ] = fixture ;
58
61
}
59
62
60
63
exports . defineFixture = defineFixture ; /*
@@ -71,7 +74,7 @@ exports.lookupFixture = lookupFixture;function makePromise(settings) {
71
74
return new Ember . RSVP . Promise ( function ( resolve , reject ) {
72
75
var fixture = lookupFixture ( settings . url ) ;
73
76
if ( fixture ) {
74
- if ( fixture . textStatus === 'success' ) {
77
+ if ( fixture . textStatus === 'success' || fixture . textStatus == null ) {
75
78
return Ember . run ( null , resolve , fixture ) ;
76
79
} else {
77
80
return Ember . run ( null , reject , fixture ) ;
Original file line number Diff line number Diff line change @@ -56,7 +56,10 @@ define("ic-ajax",
56
56
*/
57
57
58
58
function defineFixture ( url , fixture ) {
59
- __fixtures__ [ url ] = JSON . parse ( JSON . stringify ( fixture ) ) ;
59
+ if ( fixture . response ) {
60
+ fixture . response = JSON . parse ( JSON . stringify ( fixture . response ) ) ;
61
+ }
62
+ __fixtures__ [ url ] = fixture ;
60
63
}
61
64
62
65
__exports__ . defineFixture = defineFixture ; /*
@@ -73,7 +76,7 @@ define("ic-ajax",
73
76
return new Ember . RSVP . Promise ( function ( resolve , reject ) {
74
77
var fixture = lookupFixture ( settings . url ) ;
75
78
if ( fixture ) {
76
- if ( fixture . textStatus === 'success' ) {
79
+ if ( fixture . textStatus === 'success' || fixture . textStatus == null ) {
77
80
return Ember . run ( null , resolve , fixture ) ;
78
81
} else {
79
82
return Ember . run ( null , reject , fixture ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ic-ajax" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"description" : " ember friendly $.ajax wrapper" ,
5
5
"main" : " dist/cjs/main.js" ,
6
6
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments