Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #1565 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

assert_template logic is backward when expecting no template rendered

Reported by: maceywj@telus.net Assigned to: David
Priority: normal Milestone:
Component: ActiveRecord Version: 0.12.1
Severity: normal Keywords: assert block nil
Cc:

Description

assuming that index simply contains a redirect_to :action => 'list'

def test_that_should_fail
  get :list
  assert_template nil
end

def test_that_should_pass
  get :index
  assert_template nil
end

I think the logic is just inverted on line 72 of assertions.rb (according to http://ap.rubyonrails.com/classes/Test/Unit/Assertions.html)

70:         assert_block(msg) do
71:           if expected.nil?
72:             @response.rendered_with_file?
73:           else
74:             expected == rendered
75:           end
76:         end

should instead be

72:             !@response.rendered_with_file?

Change History

07/03/05 12:48:26 changed by david

  • status changed from new to closed.
  • resolution set to fixed.