summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-08-21 06:15:29 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-08-21 06:15:29 +0000
commit02fb4c3b2cbcfabb4cef86c00b6f190ddd94e412 (patch)
treed03ad356cb1e458ffdb260dbd1f17772c51cde06
parent8376311ee14abcc40854c315d30d191581bc53f6 (diff)
downloadredmine-02fb4c3b2cbcfabb4cef86c00b6f190ddd94e412.tar.gz
redmine-02fb4c3b2cbcfabb4cef86c00b6f190ddd94e412.zip
add functional test to create non default document category (#11665)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10219 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/documents_controller_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/documents_controller_test.rb b/test/functional/documents_controller_test.rb
index 140df0d6c..54faa782e 100644
--- a/test/functional/documents_controller_test.rb
+++ b/test/functional/documents_controller_test.rb
@@ -126,6 +126,23 @@ LOREM
assert_template 'new'
end
+ def test_create_non_default_category
+ @request.session[:user_id] = 2
+ category2 = Enumeration.find_by_name('User documentation')
+ category2.update_attributes(:is_default => true)
+ category1 = Enumeration.find_by_name('Uncategorized')
+ post :create,
+ :project_id => 'ecookbook',
+ :document => { :title => 'no default',
+ :description => 'This is a new document',
+ :category_id => category1.id }
+ assert_redirected_to '/projects/ecookbook/documents'
+ doc = Document.find_by_title('no default')
+ assert_not_nil doc
+ assert_equal category1.id, doc.category_id
+ assert_equal category1, doc.category
+ end
+
def test_edit
@request.session[:user_id] = 2
get :edit, :id => 1