comparison test/functional/documents_controller_test.rb @ 51:371eac10df0b live

* Merge from "cannam" branch. This includes update to Redmine trunk, plus welcome/tip-of-the-day from luisf branch.
author Chris Cannam
date Wed, 24 Nov 2010 12:20:08 +0000
parents 94944d00e43c
children af80e5618e9b
comparison
equal deleted inserted replaced
34:09b1d4349da3 51:371eac10df0b
75 :document => { :title => 'DocumentsControllerTest#test_post_new', 75 :document => { :title => 'DocumentsControllerTest#test_post_new',
76 :description => 'This is a new document', 76 :description => 'This is a new document',
77 :category_id => 2}, 77 :category_id => 2},
78 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}} 78 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
79 79
80 assert_redirected_to 'projects/ecookbook/documents' 80 assert_redirected_to '/projects/ecookbook/documents'
81 81
82 document = Document.find_by_title('DocumentsControllerTest#test_post_new') 82 document = Document.find_by_title('DocumentsControllerTest#test_post_new')
83 assert_not_nil document 83 assert_not_nil document
84 assert_equal Enumeration.find(2), document.category 84 assert_equal Enumeration.find(2), document.category
85 assert_equal 1, document.attachments.size 85 assert_equal 1, document.attachments.size
88 end 88 end
89 89
90 def test_destroy 90 def test_destroy
91 @request.session[:user_id] = 2 91 @request.session[:user_id] = 2
92 post :destroy, :id => 1 92 post :destroy, :id => 1
93 assert_redirected_to 'projects/ecookbook/documents' 93 assert_redirected_to '/projects/ecookbook/documents'
94 assert_nil Document.find_by_id(1) 94 assert_nil Document.find_by_id(1)
95 end 95 end
96 end 96 end