routing_test.rb
2.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
61
62
63
64
65
require "#{File.dirname(__FILE__)}/../test_helper"
class RoutingTest < ActionController::IntegrationTest
# home page
################################################################
def test_homepage
assert_routing('/', :controller => 'home', :action => 'index')
end
# auxiliary (development) controllers
################################################################
def test_doc_controller
#FIXME: assert_routing cannot find controllers in plugins'
flunk 'FIXME: assert_routing cannot find controllers in plugins'
assert_routing('/doc', :controller => 'doc', :action => 'index')
end
# user-targeted controllers (account/*, cms/*, customize/*)
################################################################
def test_account_controller
assert_routing('/account', :controller => 'account', :action => 'index')
end
def test_comatose_admin
#FIXME: assert_routing cannot find controllers in plugins'
flunk 'FIXME: assert_routing cannot find controllers in plugins'
assert_routing('/cms/ze', :controller => 'comatose_admin')
end
def test_edit_template
assert_routing('/customize/ze/edit_template', :controller => 'edit_template', :action => 'index', :profile => 'ze')
end
# virtual community administrative controllers (admin/*)
################################################################
def test_admin_panel_controller
assert_routing('/admin', :controller => 'admin_panel', :action => 'index')
end
def test_features_controller
assert_routing('/admin/features', :controller => 'features', :action => 'index')
assert_routing('/admin/features/update', :controller => 'features', :action => 'update')
end
def test_manage_tags_controller
assert_routing('/admin/manage_tags', :controller => 'manage_tags', :action => 'index')
end
# platform administrative controllers (metaadmin/*)
################################################################
# external public controllers
################################################################
def test_content_viewer
# profile root:
assert_routing('/ze', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze', :page => [])
# some non-root page
assert_routing('/ze/work/2007', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze', :page => ['work', "2007"])
end
end