comparison test/functional/documents_controller_test.rb @ 37:94944d00e43c

* Update to SVN trunk rev 4411
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 19 Nov 2010 13:24:41 +0000
parents 513646585e45
children af80e5618e9b
comparison
equal deleted inserted replaced
22:40f7cfd4df19 37:94944d00e43c
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