This project is archived and is in readonly mode.
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
-
José Valim August 24th, 2010 @ 02:14 PM
- Milestone cleared.
- State changed from new to open
- Assigned user set to Andrew White
- Importance changed from to High
-
Andrew White August 24th, 2010 @ 03:14 PM
- Assigned user changed from Andrew White to José Valim
Attached patch fixes issue by resetting symbolized path parameters when request is recycled.
-
Repository August 24th, 2010 @ 03:26 PM
- State changed from open to resolved
(from [11f6179f55d38dd54b69aeeb5bee9053194f0e84]) Reset symbolized path parameters when a test request is recycled [#5437 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/11f6179f55d38dd54b69aeeb5bee90... -
Repository August 24th, 2010 @ 03:27 PM
(from [78486cb9c5f25f0470114989df25894599b27329]) Reset symbolized path parameters when a test request is recycled [#5437 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/78486cb9c5f25f0470114989df2589... -
Tom Ward August 24th, 2010 @ 03:27 PM
Andrew's patch fixes this issue for me. Thanks for the swift response.
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>
People watching this ticket
Attachments
Referenced by
- 5438 RC2 Controller specs - path helpers Duplicate of #5437
- 5437 RC2: Functional tests fail when they generate a route before calling an action (from [11f6179f55d38dd54b69aeeb5bee9053194f0e84]) Reset s...
- 5437 RC2: Functional tests fail when they generate a route before calling an action (from [78486cb9c5f25f0470114989df25894599b27329]) Reset s...