Changeset 1254

Show
Ignore:
Timestamp:
2008-11-14 11:45:38 (2 months ago)
Author:
gaspard
Message:

commit f011e08bf50d05bb61f5ba6dea921430040aa112
Author: Gaspard Bucher <gaspard@teti.ch>

Added a default template for 'adminLayout' with validity tests.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/application.rb

    r1253 r1254  
    897897      when '+login' 
    898898        content =~ %r{<form[^>]* action\s*=\s*./session} 
     899      when '+adminLayout' 
     900        content =~ %r{<%= @content_for_layout %>} && %r{show_link(:admin_links)} 
    899901      else 
    900902        true 
  • trunk/app/views/templates/defaults/+login.zafu

    r1253 r1254  
    77  <meta http-equiv="Content-Language" do='void' content='fr-fr' tset_content='[v_lang]_content'/> 
    88 
    9   <r:stylesheets name='stylesheets' list='reset,zena'/> 
    10 <style> 
    11 body { font:0.9em Verdana, Arial, sans-serif; line-height:1; color:#242424; } 
    12 #login_form, #not_found { position:absolute; top:240px; left:0; width:550px; background:#9FA6AC; border:1px dotted #450009; } 
    13 #login_form div, #not_found div { float:right; font-size:0.85em; padding:5px;} 
    14 #login_form input { padding:1px; margin:0.3em; border:1px solid grey; } 
    15 #login_form table { text-align:right; margin:0;} 
    16 </style> 
     9  <r:stylesheets name='stylesheets' list='reset,zena,default'/> 
    1710</head> 
    1811<body> 
  • trunk/test/functional/session_controller_test.rb

    r1253 r1254  
    1313  end 
    1414   
    15   def test_render_invalid_template 
     15  def test_render_invalid_login 
    1616    Version.connection.execute "UPDATE #{Version.table_name} SET text = 'empty' WHERE id = #{versions_id(:Node_login_zafu_en)}" 
    1717    without_files('test.host/zafu') do 
     
    1919      assert_response :success 
    2020      assert_equal ["zafu", "default", "Node-+login", "en", "_main.erb"], @response.rendered_file.split('/')[-5..-1] 
    21       assert_match %r{There was a problem}, @response.body 
     21      assert_match %r{Using default '\+login' template}, @response.body 
    2222      assert_no_match %r{empty}, @response.body 
    2323    end 
  • trunk/test/functional/users_controller_test.rb

    r1018 r1254  
    2020    assert_equal 'Africa/Algiers', user[:time_zone] 
    2121  end 
     22   
     23  def test_render_invalid_adminLayout 
     24    login(:lion) 
     25    Version.connection.execute "UPDATE #{Version.table_name} SET text = 'empty' WHERE id = #{versions_id(:Node_admin_layout_zafu_en)}" 
     26    without_files('test.host/zafu') do 
     27      get 'index' 
     28      assert_response :success 
     29      assert_match %r{Using default '\+adminLayout' template}, @response.body 
     30      assert_no_match %r{empty}, @response.body 
     31    end 
     32  end 
    2233end