Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

RC2: Functional tests fail when they generate a route before calling an action

#5437

Given a PiratesController and the route resources :pirates, the following functional test fails:

require 'test_helper'

class PiratesControllerTest < ActionController::TestCase
  setup do
    pirates_path
    delete :destroy, :id => 1
  end
  
  test "the truth" do
    assert true
  end
end
  1) Error:
test_the_truth(PiratesControllerTest):
ActionController::RoutingError: No route matches {:relative_url_root=>nil, :action=>"destroy", :id=>1}
method _callback_before_31 in pirates_controller_test.rb at line 6

The test passes if the pirates_path is commented out.

Reported by Tom Ward · August 24th, 2010 @ 11:16 AM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: High

Activity

  1. José Valim
    José Valim
    • Milestone cleared.
    • State changed from new to open
    • Assigned user set to Andrew White
    • Importance changed from to High

    August 24th, 2010 @ 02:14 PM

  2. Andrew White
    Andrew White
    • Assigned user changed from Andrew White to José Valim

    Attached patch fixes issue by resetting symbolized path parameters when request is recycled.

    August 24th, 2010 @ 03:14 PM

  3. Repository
  4. Repository
  5. Tom Ward
    Tom Ward

    Andrew's patch fixes this issue for me. Thanks for the swift response.

    August 24th, 2010 @ 03:27 PM

  6. Jeremy Kemper