Mercurial Hosting > luan
comparison examples/blog/src/lib/test.luan @ 1218:a50803fde972
http/tools cleanup
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 20 Mar 2018 16:24:59 -0600 |
parents | 21d157b153fe |
children | 4721c482c86b |
comparison
equal
deleted
inserted
replaced
1217:4c2972f4d862 | 1218:a50803fde972 |
---|---|
26 init() | 26 init() |
27 print '/' | 27 print '/' |
28 get_page '/' | 28 get_page '/' |
29 | 29 |
30 init() | 30 init() |
31 print '/new' | 31 print '/new.html' |
32 get_page '/new' | 32 get_page '/new.html' |
33 | 33 |
34 init() | 34 init() |
35 Http.request.parameters.subject = 'test' | 35 Http.request.parameters.subject = 'test' |
36 Http.request.parameters.content = 'this is a test' | 36 Http.request.parameters.content = 'this is a test' |
37 Http.request.parameters.save = 'whatever' | 37 Http.request.parameters.save = 'whatever' |
38 print '/new submit' | 38 print '/new.html submit' |
39 get_page '/new' | 39 get_page '/new.html' |
40 local posts = Post.get_all() | 40 local posts = Post.get_all() |
41 #posts == 1 or error() | 41 #posts == 1 or error() |
42 local post_id = to_string(posts[1].id) | 42 local post_id = to_string(posts[1].id) |
43 | 43 |
44 init() | 44 init() |
45 Http.request.parameters.post = post_id | 45 Http.request.parameters.post = post_id |
46 print '/edit' | 46 print '/edit.html' |
47 get_page '/edit' | 47 get_page '/edit.html' |
48 | 48 |
49 init() | 49 init() |
50 Http.request.parameters.post = post_id | 50 Http.request.parameters.post = post_id |
51 Http.request.parameters.subject = 'test' | 51 Http.request.parameters.subject = 'test' |
52 Http.request.parameters.content = 'this is an edit' | 52 Http.request.parameters.content = 'this is an edit' |
53 Http.request.parameters.save = 'whatever' | 53 Http.request.parameters.save = 'whatever' |
54 print '/edit submit' | 54 print '/edit.html submit' |
55 get_page '/edit' | 55 get_page '/edit.html' |
56 | 56 |
57 init() | 57 init() |
58 print '/ again' | 58 print '/ again' |
59 page = get_page '/' | 59 page = get_page '/' |
60 matches(page,'this is an edit') or error() | 60 matches(page,'this is an edit') or error() |