summaryrefslogtreecommitdiffstats
path: root/test/functional/wiki_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-02-28 09:43:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-02-28 09:43:13 +0000
commitc174540a0e39a4d785d9b99535176b0c92cd1958 (patch)
tree46d23c12eb3a519a0be6498bea6e945c7f8b326f /test/functional/wiki_controller_test.rb
parent02cc0efdd7b9d10e12a9a335befdab4d4458d4a3 (diff)
downloadredmine-c174540a0e39a4d785d9b99535176b0c92cd1958.tar.gz
redmine-c174540a0e39a4d785d9b99535176b0c92cd1958.zip
Adds attachments upload on wiki edit form (#1223).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3500 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/wiki_controller_test.rb')
-rw-r--r--test/functional/wiki_controller_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index cf247db80..3f9ac7eac 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -107,6 +107,23 @@ class WikiControllerTest < ActionController::TestCase
assert_equal 'Created the page', page.content.comments
end
+ def test_create_page_with_attachments
+ @request.session[:user_id] = 2
+ assert_difference 'WikiPage.count' do
+ assert_difference 'Attachment.count' do
+ post :edit, :id => 1,
+ :page => 'New page',
+ :content => {:comments => 'Created the page',
+ :text => "h1. New page\n\nThis is a new page",
+ :version => 0},
+ :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
+ end
+ end
+ page = Project.find(1).wiki.find_page('New page')
+ assert_equal 1, page.attachments.count
+ assert_equal 'testfile.txt', page.attachments.first.filename
+ end
+
def test_preview_routing
assert_routing(
{:method => :post, :path => '/projects/567/wiki/CookBook_documentation/preview'},