root/GearsORM/trunk/tests/test_introspection.html

Revision 344, 1.5 kB (checked in by uriel, 1 year ago)

*removed two commas that bothered IE

Line 
1 <html>
2         <head>
3                 <script src="../gears_init.js"></script>
4                 <script src="../GearsORM.js"></script>
5                 <script src="../GearsORM.Events.js"></script>
6                 <script src="../GearsORM.ResultIterator.js"></script>
7                 <script src="../GearsORM.Sql.js"></script>
8                 <script src="../GearsORM.Fields.js"></script>
9                 <script src="../GearsORM.Model.js"></script>
10                 <script src="../GearsORM.Introspection.js"></script>
11                 <script src="../GearsORM.Transaction.js"></script>
12                 <script>
13                         GearsORM.dbName = "test.introspection";
14                         var Model1 = new GearsORM.Model({
15                                 name:"Model1",
16                                 fields:
17                                 {
18                                         name:new GearsORM.Fields.String({maxLength:25})
19                                 }
20                         });
21                         var Model2 = new GearsORM.Model({
22                                 name:"Model2",
23                                 fields:
24                                 {
25                                         name:new GearsORM.Fields.String({maxLength:25})
26                                 }
27                         });
28                        
29                         var Tests =
30                         {
31                                 up:function()
32                                 {
33                                         Model1.dropTable();
34                                         Model2.dropTable();
35                                 },
36                                 "test if doesTableExist work":function()
37                                 {
38                                         UnitTest.assertFalse(GearsORM.Introspection.doesTableExist("Model1","Model2"));
39                                         Model1.createTable();
40                                         UnitTest.assertTrue(GearsORM.Introspection.doesTableExist("Model1"));
41                                         Model2.createTable();
42                                         UnitTest.assertTrue(GearsORM.Introspection.doesTableExist("Model2"));
43                                         UnitTest.assertTrue(GearsORM.Introspection.doesTableExist("Model1","Model2"));
44                                 },
45                                 down:function()
46                                 {
47                                         Model1.dropTable();
48                                         Model2.dropTable();
49                                 }
50                         };
51                 </script>
52                 <script src="unit_test.js"></script>
53         </head>
54         <body>
55                
56         </body>
57 </html>
Note: See TracBrowser for help on using the browser.