Skip to content

Commit

Permalink
Merge branch 'router'
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Sobel committed May 25, 2012
2 parents c939a88 + fb1d6ca commit 564aaba
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions dbpy_test/files/renderfile.dbpy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dbpy.io.file.render('existing/sample_text.txt')
1 change: 1 addition & 0 deletions dbpy_test/files/renderjson.dbpy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dbpy.io.json.render('existing/sample_json.json')
4 changes: 4 additions & 0 deletions dbpy_test/http/errorresponse.dbpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@



dbpy.http.error(500,"ERROR")
28 changes: 28 additions & 0 deletions dbpy_test/test_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ $('document').ready(function() {
return data == "This is a file to test for the ability to read files.\nSecond line.\n";
});
});
asyncTest("Render File",function() {
expect(1);
ajaxAssert('files/renderfile.dbpy',"Did not read file correctly",function(data,msg,response) {
return data == "This is a file to test for the ability to read files.\nSecond line.";
});
});


asyncTest("Load json",function() {
Expand All @@ -71,6 +77,13 @@ $('document').ready(function() {
});
});

asyncTest("Render json",function() {
expect(1);
ajaxAssert('files/renderjson.dbpy',"Did not render json correctly",function(data,msg,response) {
return data.id == 5;
});
});

asyncTest("Write file",function() {
expect(1);
ajaxAssert('files/writefile.dbpy',"Did not correctly write file",function(data,msg,response) {
Expand Down Expand Up @@ -147,6 +160,21 @@ $('document').ready(function() {
});
});

asyncTest("Error",function() {
expect(1);
$.ajax('http/errorresponse.dbpy',{
success: function(data) {
ok(false,"this was supposed to be an error!");
},
error: function(ob,mes,err) {
ok(true,"Sweet, an error");
start();
}

});

});

asyncTest("Get Params",function() {
expect(1);
ajaxAssert('http/getparams.dbpy?foo=bar&list=1&list=2',"Get Params not working",function(data,msg,response) {
Expand Down

0 comments on commit 564aaba

Please sign in to comment.