Changeset 1191

Show
Ignore:
Timestamp:
01/06/08 23:06:36 (11 months ago)
Author:
wyca..@gmail.com
Message:

Fixes some test stuff to be simpler; fixes HAML locals to delete the option so HAML trunk doesn't throw warnings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/merb/template/haml.rb

    r1176 r1191  
    4141          begin  
    4242 
    43             opts[:locals] = {} # Merb handles the locals 
     43            # Merb handles the locals 
     44            opts.delete(:locals) 
    4445             
    4546            template = text ? text : load_template(file) 
  • trunk/lib/merb/test/helper.rb

    r1163 r1191  
    99       
    1010      # Create a FakeRequest suitable for passing to Controller.build 
    11       def fake_request(path="/",method='GET'
     11      def fake_request(params = {}
    1212        method = method.to_s.upcase 
    13         Merb::Test::FakeRequest.with(path, :request_method => method
     13        Merb::Test::FakeRequest.with("/", {:request_method => "GET"}.merge(params)
    1414      end 
    15  
     15       
    1616      # For integration/functional testing 
    1717      def request(verb, path) 
     
    8484      # end 
    8585      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, {}) 
    8788        yield result[1] if block_given? 
    8889        result 
     
    121122        klass = controller.class == Class ? controller : controller.class 
    122123        @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
    124125        yield @controller if block_given? 
    125126        [@controller, @controller.dispatch(action.to_sym)]