Bringing various things inline with the current state of Rails develolpment

This commit is contained in:
Alexey Verkhovsky 2005-03-25 19:11:41 +00:00
parent 0a63789e61
commit 8de7ca3cee
38 changed files with 204 additions and 5484 deletions

View file

@ -35,7 +35,7 @@ class WikiControllerTest < Test::Unit::TestCase
@web.password = 'pswd'
r = process('authenticate', 'web' => 'wiki1', 'password' => 'wrong password')
assert_redirected_to :action => 'login'
assert_redirected_to :action => 'login', :web => 'wiki1'
assert_nil r.cookies['web_address']
end

View file

@ -1,5 +1,5 @@
ENV['RAILS_ENV'] ||= 'test'
require File.dirname(__FILE__) + '/../config/environment'
ENV['RAILS_ENV'] = 'test'
require File.expand_path(File.dirname(__FILE__) + '/../config/environment')
require 'application'
require 'test/unit'
require 'action_controller/test_process'
@ -56,23 +56,6 @@ class Test::Unit::TestCase
ApplicationController.wiki = nil
end
# Checks that a given URI path is recognized as expected options
# Delete it when patch #638 is commiteed to Rails (http://dev.rubyonrails.org/ticket/638)
def assert_recognizes(expected_options, path)
# Load routes.rb if it hasn't been loaded.
ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?
# Assume given controller
request = ActionController::TestRequest.new({}, {}, nil)
request.path = path
ActionController::Routing::Routes.recognize!(request)
msg = build_message(nil, "The recognized options <?> did not match <?>",
request.path_parameters, expected_options)
assert_block(msg) { request.path_parameters == expected_options }
end
end
class WikiServiceWithNoPersistence

View file

@ -46,7 +46,7 @@ class RevisionTest < Test::Unit::TestCase
@revision.display_content
end
def test_bluecloth
def test_markdown
@web.markup = :markdown
assert_markup_parsed_as(
@ -220,6 +220,8 @@ class RevisionTest < Test::Unit::TestCase
end
def test_link_to_pic
FileUtils.mkdir_p "#{RAILS_ROOT}/storage/test/wiki1"
FileUtils.rm(Dir["#{RAILS_ROOT}/storage/test/wiki1/*"])
@wiki.file_yard(@web).upload_file('square.jpg', StringIO.new(''))
assert_markup_parsed_as(
'<p><img alt="Square" src="../pic/square.jpg" /></p>',