Mercurial > hg > soundsoftware-site
comparison test/functional/documents_controller_test.rb @ 1526:404aa68d4227
Merge from live branch
author | Chris Cannam |
---|---|
date | Thu, 11 Sep 2014 12:46:20 +0100 |
parents | dffacf8a6908 |
children |
comparison
equal
deleted
inserted
replaced
1493:a5f2bdf3b486 | 1526:404aa68d4227 |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2012 Jean-Philippe Lang | 2 # Copyright (C) 2006-2014 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
178 @request.session[:user_id] = 2 | 178 @request.session[:user_id] = 2 |
179 assert_difference 'Attachment.count' do | 179 assert_difference 'Attachment.count' do |
180 post :add_attachment, :id => 1, | 180 post :add_attachment, :id => 1, |
181 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}} | 181 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}} |
182 end | 182 end |
183 attachment = Attachment.first(:order => 'id DESC') | 183 attachment = Attachment.order('id DESC').first |
184 assert_equal Document.find(1), attachment.container | 184 assert_equal Document.find(1), attachment.container |
185 end | 185 end |
186 end | 186 end |