public
Fork of wycats/merb-core
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/hookercookerman/merb-core.git
Search Repo:
spec included for request_helper#request to handle namespace
Wed Apr 23 08:33:11 -0700 2008
commit  2199a99fbc234d470913823756292c6fe05fb4ba
tree    3a3ae38cae8690053d93839e889f65bf5f6622ee
parent  4e507e7227e6b7536a0143cba8c5867d6389d62c
...
245
246
247
248
 
249
250
251
...
245
246
247
 
248
249
250
251
0
@@ -245,7 +245,7 @@ module Merb
0
         request = fake_request(env)
0
 
0
         opts = check_request_for_route(request) # Check that the request will be routed correctly
0
- controller_name = (opts[:namespace] ? opts[:namespace] + '/' : '') + opts.delete[:controller]
0
+ controller_name = (opts[:namespace] ? opts[:namespace] + '/' : '') + opts.delete(:controller)
0
         klass = Object.full_const_get(controller_name.to_const_string)
0
         action = opts.delete(:action).to_s
0
         params.merge!(opts)
...
160
161
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
164
165
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
0
@@ -160,6 +160,22 @@ describe Merb::Test::RequestHelper do
0
       controller.params[:id].should == "my_id"
0
     end
0
   end
0
+
0
+ describe "#request" do
0
+ before(:each) do
0
+ Merb::Router.prepare do |r|
0
+ r.namespace :admin do |admin|
0
+ admin.resources :request_controller
0
+ end
0
+ end
0
+ end
0
+
0
+ it "should get to the new action with namespace" do
0
+ Merb::Test::ControllerAssertionMock.should_receive(:called).with(:new)
0
+ controller = request("/admin/request_controller/new")
0
+ controller.params[:namespace].should == "admin"
0
+ end
0
+ end
0
 end
0
 
0
 module Merb::Test::RequestHelper

Comments

    No one has commented yet.