public
Rubygem
Description: JSON Web App Framework
Homepage: http://halcyon.rubyforge.org/
Clone URL: git://github.com/mtodd/halcyon.git
Click here to lend your support to: halcyon and make a donation at www.pledgie.com !
Added failing spec for nested controllers.
mtodd (author)
Thu Sep 18 21:26:32 -0700 2008
commit  a74e0bce64c6a8bfe02df1d09d7e38239bc205ed
tree    327ab4c2e6e9347cde1f38741e43a846b10fa63d
parent  238909fc750e790d26a7bb4266b3a01679c1b59d
...
61
62
63
 
 
 
 
 
64
...
61
62
63
64
65
66
67
68
69
0
@@ -61,4 +61,9 @@ describe "Halcyon::Application" do
0
     body['body'].should == "Internal Server Error"
0
   end
0
   
0
+  it "should dispatch to controllers inside of modules" do
0
+    response = Rack::MockRequest.new(@app).get("/nested/tests")
0
+    response.status.should == 200
0
+  end
0
+  
0
 end
...
85
86
87
 
 
 
 
 
 
 
 
 
 
 
88
89
90
...
100
101
102
 
103
104
105
...
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
...
111
112
113
114
115
116
117
0
@@ -85,6 +85,17 @@ class Resources < Application
0
   end
0
 end
0
 
0
+# Nested controller
0
+module Nested
0
+  class Tests
0
+    
0
+    def index
0
+      ok
0
+    end
0
+    
0
+  end
0
+end
0
+
0
 # Models
0
 
0
 class Model
0
@@ -100,6 +111,7 @@ Halcyon.configurable_attr(:environment)
0
 Halcyon::Application.route do |r|
0
   r.resources :resources
0
   
0
+  r.match('/nested/tests').to(:controller => 'nested/tests', :action => 'index')
0
   r.match('/hello/:name').to(:controller => 'specs', :action => 'greeter')
0
   r.match('/:action').to(:controller => 'specs')
0
   r.match('/:controller/:action').to()

Comments