Changeset 1191
- Timestamp:
- 01/06/08 23:06:36 (11 months ago)
- Files:
-
- trunk/lib/merb/template/haml.rb (modified) (1 diff)
- trunk/lib/merb/test/helper.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/merb/template/haml.rb
r1176 r1191 41 41 begin 42 42 43 opts[:locals] = {} # Merb handles the locals 43 # Merb handles the locals 44 opts.delete(:locals) 44 45 45 46 template = text ? text : load_template(file) trunk/lib/merb/test/helper.rb
r1163 r1191 9 9 10 10 # Create a FakeRequest suitable for passing to Controller.build 11 def fake_request(pa th="/",method='GET')11 def fake_request(params = {}) 12 12 method = method.to_s.upcase 13 Merb::Test::FakeRequest.with( path, :request_method => method)13 Merb::Test::FakeRequest.with("/", {:request_method => "GET"}.merge(params)) 14 14 end 15 15 16 16 # For integration/functional testing 17 17 def request(verb, path) … … 84 84 # end 85 85 def with_route(the_path, _method = "GET") 86 result = Merb::Router.match(fake_request(the_path, _method), {}) 86 _fake_request = Merb::Test::FakeRequest.with(the_path, :request_method => _method) 87 result = Merb::Router.match(_fake_request, {}) 87 88 yield result[1] if block_given? 88 89 result … … 121 122 klass = controller.class == Class ? controller : controller.class 122 123 @controller = klass.build(fake_request) 123 @controller.stub!(:params).and_return(opts.merge !(:controller => klass.name.downcase, :action => action.to_s))124 @controller.stub!(:params).and_return(opts.merge(:controller => klass.name.downcase, :action => action.to_s).to_mash) 124 125 yield @controller if block_given? 125 126 [@controller, @controller.dispatch(action.to_sym)]
