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

Ticket #8867: test_multiple_layout_with_only_and_except_conditions.diff

File test_multiple_layout_with_only_and_except_conditions.diff, 0.8 kB (added by mikong, 1 year ago)
  • test/controller/layout_test.rb

    old new  
    151151  end 
    152152end 
    153153 
     154class MultipleLayoutController < LayoutTest 
     155  layout 'layout_test', :only => [:hello] 
     156  layout 'item', :except => [:hello] 
     157 
     158  def hello 
     159  end 
     160end 
     161 
    154162class LayoutSetInResponseTest < Test::Unit::TestCase 
    155163  def setup 
    156164    @request    = ActionController::TestRequest.new 
     
    180188    get :hello 
    181189    assert_nil @response.layout 
    182190  end 
     191 
     192  def test_layout_with_except_condition_and_parent_with_only_condition 
     193    @controller = MultipleLayoutController.new 
     194    get :hello 
     195    assert_not_equal 'layouts/item', @response.layout 
     196  end 
    183197end 
    184198 
    185199