This project is archived and is in readonly mode.

#5437 ✓resolved
Tom Ward

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

Reported by Tom Ward | August 24th, 2010 @ 11:16 AM | in 3.0.2

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.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages