mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-06 23:51:31 +00:00
Merged r9984 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.0-stable@9999 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
873a5cda4f
commit
7dde34460c
@ -24,6 +24,7 @@ class Attachment < ActiveRecord::Base
|
||||
validates_presence_of :filename, :author
|
||||
validates_length_of :filename, :maximum => 255
|
||||
validates_length_of :disk_filename, :maximum => 255
|
||||
validates_length_of :description, :maximum => 255
|
||||
validate :validate_max_file_size
|
||||
|
||||
acts_as_event :title => :filename,
|
||||
|
||||
@ -75,6 +75,12 @@ class AttachmentTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_description_length_should_be_validated
|
||||
a = Attachment.new(:description => 'a' * 300)
|
||||
assert !a.save
|
||||
assert_not_nil a.errors[:description]
|
||||
end
|
||||
|
||||
def test_destroy
|
||||
a = Attachment.new(:container => Issue.find(1),
|
||||
:file => uploaded_test_file("testfile.txt", "text/plain"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user