Changeset 689
- Timestamp:
- 01/07/08 10:54:30 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/rails2/app/controllers/admin/export_controller.rb
r576 r689 1 1 class Admin::ExportController < ApplicationController 2 2 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" 5 4 end 6 5 end branches/rails2/test/functional/admin/export_controller_test.rb
r523 r689 7 7 class Admin::ExportControllerTest < Test::Unit::TestCase 8 8 fixtures :users, :pages 9 test_helper :login 9 test_helper :login, :page 10 10 11 11 def setup … … 13 13 @request = ActionController::TestRequest.new 14 14 @response = ActionController::TestResponse.new 15 login_as (:developer)15 login_as :developer 16 16 end 17 17 18 18 def test_yaml 19 19 get :yaml 20 20 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 22 22 end 23 23 end branches/rails2/test/functional/admin/page_controller_test.rb
r526 r689 13 13 @request = ActionController::TestRequest.new 14 14 @response = ActionController::TestResponse.new 15 login_as (:existing)15 login_as :existing 16 16 17 17 @page_title = 'Just a Test' … … 270 270 assert_equal 1, assigns(:level) 271 271 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 273 274 end 274 275
