Class: DbFileTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
BaseAttachmentTests
Defined in:
lib/test/backends/db_file_test.rb

Instance Method Summary collapse

Methods included from BaseAttachmentTests

#test_no_reassign_attribute_data_on_nil, #test_reassign_attribute_data, #test_should_create_file_from_uploaded_file, #test_should_overwrite_old_contents_when_updating, #test_should_save_without_updating_file

Instance Method Details

#test_should_call_after_attachment_saved(klass = Attachment) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/test/backends/db_file_test.rb', line 7

def test_should_call_after_attachment_saved(klass = Attachment)
  attachment_model.saves = 0
  assert_created do
    upload_file :filename => '/files/rails.png'
  end
  assert_equal 1, attachment_model.saves
end