This project is archived and is in readonly mode.
![Dmytrii Nagirniak Dmytrii Nagirniak](/images/avatar-large.gif)
assert_redirected_to and assert_template should not both pass
Reported by Dmytrii Nagirniak | October 17th, 2010 @ 11:59 PM | in 3.1
The integration unit test:
require 'test_helper'
class TransactionImportsTest < ActionController::IntegrationTest
test "should fail" do
get '/transaction_imports/new'
post '/transaction_imports' # rendered template is still "new" here!
assert_redirected_to(transaction_imports_url)
assert_template('new')
end
end
passes, while it is expected to fail because the last response is redirect.
The 'post', 'get' etc should create a new request (only preserving the session info, cookies etc) to ensure the isolation between requests.
Originated from RSpec issue
Comments and changes to this ticket
-
Andrew White October 18th, 2010 @ 10:05 AM
- State changed from new to open
- Milestone set to 3.1
- Assigned user set to Andrew White
- Importance changed from to Low
Looks like the assert_template instance variables don't get reset between requests - fix forthcoming.
-
Repository October 18th, 2010 @ 10:06 AM
- State changed from open to resolved
(from [141cba8f1d6135d0f498e392dda53f966a5f806d]) Reset assert_template instance variables between requests [#5832 state:resolved] http://github.com/rails/rails/commit/141cba8f1d6135d0f498e392dda53f...
-
Repository October 18th, 2010 @ 10:06 AM
(from [f7573175de7c584ee9c256fb567311adc2de04b9]) Reset assert_template instance variables between requests [#5832 state:resolved] http://github.com/rails/rails/commit/f7573175de7c584ee9c256fb567311...
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
Referenced by
-
5832 assert_redirected_to and assert_template should not both pass (from [141cba8f1d6135d0f498e392dda53f966a5f806d]) Reset a...
-
5832 assert_redirected_to and assert_template should not both pass (from [f7573175de7c584ee9c256fb567311adc2de04b9]) Reset a...