Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
27eab3ee41
2 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,7 @@ class Wiki
|
|||
def move_files(old_path, new_path)
|
||||
return if new_path == old_path
|
||||
default_path = Rails.root.join("webs", "files")
|
||||
FileUtils.rmdir(new_path)
|
||||
FileUtils.rmdir(new_path) if File.exist?(new_path)
|
||||
if [old_path, new_path].include? default_path
|
||||
File.rename(old_path, new_path)
|
||||
FileUtils.rmdir(old_path.parent) unless old_path == default_path
|
||||
|
|
|
@ -140,6 +140,7 @@ class AdminControllerTest < ActionController::TestCase
|
|||
assert @web.allow_uploads?
|
||||
assert_equal 300, @web.max_upload_size
|
||||
assert File.directory? Rails.root.join("webs", "renamed_wiki1", "files")
|
||||
assert !File.exist?(Rails.root.join("webs", "renamed_wiki1", "wiki1"))
|
||||
assert !File.exist?(Rails.root.join("webs", "wiki1"))
|
||||
end
|
||||
|
||||
|
@ -157,6 +158,7 @@ class AdminControllerTest < ActionController::TestCase
|
|||
assert_response :success
|
||||
assert @response.has_template_object?('error')
|
||||
assert File.directory? Rails.root.join("webs", "wiki1", "files")
|
||||
assert !File.exist?(Rails.root.join("webs", "renamed_wiki1", "wiki1"))
|
||||
assert !File.exist?(Rails.root.join("webs", "renamed_wiki1"))
|
||||
end
|
||||
|
||||
|
@ -179,6 +181,7 @@ class AdminControllerTest < ActionController::TestCase
|
|||
assert !@web.count_pages?
|
||||
assert !@web.allow_uploads?
|
||||
assert File.directory? Rails.root.join("webs", "renamed_wiki1", "files")
|
||||
assert !File.exist?(Rails.root.join("webs", "renamed_wiki1", "wiki1"))
|
||||
assert !File.exist?(Rails.root.join("webs", "wiki1"))
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue