-
Notifications
You must be signed in to change notification settings - Fork 368
Expand file tree
/
Copy pathapp_plugin_model_controller.js
More file actions
60 lines (46 loc) · 1.34 KB
/
app_plugin_model_controller.js
File metadata and controls
60 lines (46 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
load('steal/rhino/rhino.js')
load('steal/rhino/test.js');
(function(rhinoSteal){
_S = steal.test;
_S.module("jquery/generate")
STEALPRINT = false;
_S.test("app" , function(t){
_args = ['cnu'];
load('jquery/generate/app');
_S.clear();
_S.open('cnu/cnu.html')
t.ok(typeof steal !== 'undefined', "steal is fine")
_S.clear();
})
_S.test("app 2 levels deep" , function(t){
_args = ['cnu/widget'];
load('jquery/generate/plugin');
_S.clear();
_S.open('cnu/widget/widget.html')
t.ok(typeof steal !== 'undefined', "steal is fine")
_S.clear();
})
/**
* Tests generating a very basic controller and model
*/
_S.test("controller, model, and page" , function(t){
_args = ['Cnu.Todos'];
load('jquery/generate/controller');
_S.clear();
_args = ['Cnu.Models.Todo'];
load('jquery/generate/model');
_S.clear();
cnuContent = readFile('cnu/cnu.js')
+"\n.then('./models/todo.js')"
+"\n.then('./todos/todos.js')";
load('steal/rhino/rhino.js')
new steal.File('cnu/cnu.js').save( cnuContent );
_args = ['cnu','cnugen.html'];
load('jquery/generate/page');
_S.clear();
_S.open('cnu/cnugen.html');
t.ok(typeof Cnu.Todos !== 'undefined',"load Cnu.Controllers.Todos")
t.ok(typeof Cnu.Models.Todo !== 'undefined', "load Cnu.Models.Todo")
rhinoSteal.File("cnu").removeDir();
})
})(steal);