2005-01-24 19:52:04 +01:00
|
|
|
# Unit tests for ApplicationController (the abstract controller class)
|
|
|
|
|
|
|
|
require File.dirname(__FILE__) + '/../test_helper'
|
|
|
|
require 'wiki_controller'
|
|
|
|
require 'rexml/document'
|
|
|
|
|
|
|
|
# Need some concrete class to test the abstract class features
|
|
|
|
class WikiController; def rescue_action(e) logger.error(e); raise e end; end
|
|
|
|
|
|
|
|
class ApplicationTest < Test::Unit::TestCase
|
2005-08-09 04:20:28 +02:00
|
|
|
fixtures :webs, :pages, :revisions, :system
|
|
|
|
|
2005-01-24 19:52:04 +01:00
|
|
|
def setup
|
2005-08-09 04:20:28 +02:00
|
|
|
@controller = WikiController.new
|
|
|
|
@request = ActionController::TestRequest.new
|
|
|
|
@response = ActionController::TestResponse.new
|
|
|
|
@wiki = Wiki.new
|
2005-01-24 19:52:04 +01:00
|
|
|
end
|
2005-08-09 04:20:28 +02:00
|
|
|
|
2005-01-24 19:52:04 +01:00
|
|
|
def test_utf8_header
|
2005-08-09 04:20:28 +02:00
|
|
|
get :show, :web => 'wiki1', :id => 'HomePage'
|
|
|
|
assert_equal 'text/html; charset=UTF-8', @response.headers['Content-Type']
|
2005-01-24 19:52:04 +01:00
|
|
|
end
|
2005-03-26 00:40:03 +01:00
|
|
|
|
|
|
|
def test_connect_to_model_unknown_wiki
|
2005-08-09 04:20:28 +02:00
|
|
|
get :show, :web => 'unknown_wiki', :id => 'HomePage'
|
|
|
|
assert_response :missing
|
2005-03-26 00:40:03 +01:00
|
|
|
end
|
2005-01-24 19:52:04 +01:00
|
|
|
|
|
|
|
end
|