Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8992

Show
Ignore:
Timestamp:
03/08/08 12:56:41 (6 months ago)
Author:
pratik
Message:

Allow using named routes in ActionController::TestCase before any request has been made. Closes #11273 [alloy]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r8990 r8992  
    11*SVN* 
     2 
     3* Allow using named routes in ActionController::TestCase before any request has been made. Closes #11273 [alloy] 
    24 
    35* Fixed that sweepers defined by cache_sweeper will be added regardless of the perform_caching setting. Instead, control whether the sweeper should be run with the perform_caching setting. This makes testing easier when you want to turn perform_caching on/off [DHH] 
  • trunk/actionpack/lib/action_controller/test_case.rb

    r8749 r8992  
    5858    def setup_controller_request_and_response 
    5959      @controller = self.class.controller_class.new 
    60       @request    = TestRequest.new 
    61       @response   = TestResponse.new 
     60      @controller.request = @request = TestRequest.new 
     61      @response = TestResponse.new 
    6262    end 
    6363 end 
  • trunk/actionpack/test/controller/test_test.rb

    r8782 r8992  
    654654  end 
    655655end 
     656 
     657class NamedRoutesControllerTest < ActionController::TestCase 
     658  tests ContentController 
     659   
     660  def test_should_be_able_to_use_named_routes_before_a_request_is_done 
     661    with_routing do |set| 
     662      set.draw { |map| map.resources :contents } 
     663      assert_equal 'http://test.host/contents/new', new_content_url 
     664    end 
     665  end 
     666end