Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
DalSoft
committed
Sep 24, 2011
1 parent
b98dbc3
commit 7309116
Showing
3 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,17 +1,33 @@ | |||
$(function () { | $(function() { | ||
jg.init({ | jg.init({ }); | ||
apiKey: 'decbf1d2', | |||
rootDomain: 'https://api.staging.justgiving.com', | |||
onResponse: function (data) { | |||
alert(data); | |||
} | |||
}); | |||
jg.http.get({ url: "https://api.justgiving.com/ea902521/v1/fundraising/pages/justgiving", overrideCallback: function (data) { alert(data.pageId); } }); | |||
|
|
||
module("jquery.http.js"); | module("jquery.http.js"); | ||
|
|
||
test("first test within module", function () { | test("ajaxSetup dataType should equal dataType jsonp", function () { | ||
ok(true, "all pass"); | equal($.ajaxSetup().dataType, 'jsonX'); | ||
}); | |||
|
|||
|
|||
asyncTest("Api result should be return when given a vaild Api resource", function() { | |||
jg.http.get({ | |||
url: "https://api.justgiving.com/ea902521/v1/fundraising/pages/justgiving", | |||
overrideCallback: function(data) { | |||
equal(data.pageId, '123'); | |||
start(); | |||
} | |||
}); | |||
|
|||
}); | |||
|
|||
asyncTest("xhr status return given a vaild Api resource", function() { | |||
jg.http.get({ | |||
url: "https://api.justgiving.com/ea902521/v1/fundraising/pages/justgiving", | |||
overrideCallback: function(data) { | |||
equal(data.xhr.status, '200'); | |||
start(); | |||
} | |||
}); | |||
|
|||
}); | }); | ||
|
|
||
}); | }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters