Mercurial > hg > soundsoftware-site
comparison test/functional/files_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 | 40f7cfd4df19 |
children | af80e5618e9b |
comparison
equal
deleted
inserted
replaced
22:40f7cfd4df19 | 37:94944d00e43c |
---|---|
35 assert_difference 'Attachment.count' do | 35 assert_difference 'Attachment.count' do |
36 post :create, :project_id => 1, :version_id => '', | 36 post :create, :project_id => 1, :version_id => '', |
37 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}} | 37 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}} |
38 assert_response :redirect | 38 assert_response :redirect |
39 end | 39 end |
40 assert_redirected_to 'projects/ecookbook/files' | 40 assert_redirected_to '/projects/ecookbook/files' |
41 a = Attachment.find(:first, :order => 'created_on DESC') | 41 a = Attachment.find(:first, :order => 'created_on DESC') |
42 assert_equal 'testfile.txt', a.filename | 42 assert_equal 'testfile.txt', a.filename |
43 assert_equal Project.find(1), a.container | 43 assert_equal Project.find(1), a.container |
44 | 44 |
45 mail = ActionMailer::Base.deliveries.last | 45 mail = ActionMailer::Base.deliveries.last |
56 assert_difference 'Attachment.count' do | 56 assert_difference 'Attachment.count' do |
57 post :create, :project_id => 1, :version_id => '2', | 57 post :create, :project_id => 1, :version_id => '2', |
58 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}} | 58 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}} |
59 assert_response :redirect | 59 assert_response :redirect |
60 end | 60 end |
61 assert_redirected_to 'projects/ecookbook/files' | 61 assert_redirected_to '/projects/ecookbook/files' |
62 a = Attachment.find(:first, :order => 'created_on DESC') | 62 a = Attachment.find(:first, :order => 'created_on DESC') |
63 assert_equal 'testfile.txt', a.filename | 63 assert_equal 'testfile.txt', a.filename |
64 assert_equal Version.find(2), a.container | 64 assert_equal Version.find(2), a.container |
65 end | 65 end |
66 | 66 |