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.

assert_redirected_to and assert_template should not both pass

#5832

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

Reported by Dmytrii Nagirniak · October 17th, 2010 @ 11:59 PM

State: resolved
Milestone: 3.1
Assigned to: Andrew White Andrew White
Importance: Low

Activity

  1. Andrew White
    Andrew White
    • 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.

    October 18th, 2010 @ 10:05 AM

  2. Repository
  3. Repository