Changeset 689

Show
Ignore:
Timestamp:
01/07/08 10:54:30 (6 months ago)
Author:
jlong
Message:

rails2: fixed content type test failures

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/rails2/app/controllers/admin/export_controller.rb

    r576 r689  
    11class Admin::ExportController < ApplicationController 
    22  def yaml 
    3     response.headers['Content-Type'] = "text/yaml" 
    4     render :text => Radiant::Exporter.export 
     3    render :text => Radiant::Exporter.export, :content_type => "text/yaml" 
    54  end 
    65end 
  • branches/rails2/test/functional/admin/export_controller_test.rb

    r523 r689  
    77class Admin::ExportControllerTest < Test::Unit::TestCase 
    88  fixtures :users, :pages 
    9   test_helper :login 
     9  test_helper :login, :page 
    1010   
    1111  def setup 
     
    1313    @request    = ActionController::TestRequest.new 
    1414    @response   = ActionController::TestResponse.new 
    15     login_as(:developer) 
     15    login_as :developer 
    1616  end 
    17  
     17   
    1818  def test_yaml 
    1919    get :yaml 
    2020    assert_kind_of Hash, YAML.load(@response.body) 
    21     assert_equal 'text/yaml; charset=utf-8', @response.headers['Content-Type'] 
     21    assert_equal 'text/yaml', @response.content_type 
    2222  end 
    2323end 
  • branches/rails2/test/functional/admin/page_controller_test.rb

    r526 r689  
    1313    @request    = ActionController::TestRequest.new 
    1414    @response   = ActionController::TestResponse.new 
    15     login_as(:existing) 
     15    login_as :existing 
    1616     
    1717    @page_title = 'Just a Test' 
     
    270270    assert_equal 1, assigns(:level) 
    271271    assert ! %r{<head>}.match(@response.body) 
    272     assert_equal 'text/html;charset=utf-8', @response.headers['Content-Type'] 
     272    assert_equal 'text/html', @response.content_type 
     273    assert_equal 'utf-8', @response.charset 
    273274  end 
    274275