Class: DeleteFileColumnTest

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



6
7
8
9
10
11
# File 'lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb', line 6

def setup
  MockModel.extend ActiveScaffold::Bridges::FileColumn::FileColumnHelpers
  ActiveScaffold::Bridges::FileColumn::FileColumnHelpers.generate_delete_helpers(MockModel)
  @model = MockModel.new
  @model.band_image = 'coolio.jpg'
end

#test__delete_band_image__boolean__should_deleteObject



17
18
19
20
# File 'lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb', line 17

def test__delete_band_image__boolean__should_delete
  @model.delete_band_image = true
  assert_nil @model.band_image
end

#test__delete_band_image__boolean_false__shouldnt_deleteObject



27
28
29
30
# File 'lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb', line 27

def test__delete_band_image__boolean_false__shouldnt_delete
  @model.delete_band_image = false
  refute_nil @model.band_image
end

#test__delete_band_image__string__should_deleteObject



22
23
24
25
# File 'lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb', line 22

def test__delete_band_image__string__should_delete
  @model.delete_band_image = 'true'
  assert_nil @model.band_image
end

#test__delete_band_image__string_false__shouldnt_deleteObject



32
33
34
35
# File 'lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb', line 32

def test__delete_band_image__string_false__shouldnt_delete
  @model.delete_band_image = 'false'
  refute_nil @model.band_image
end

#test__file_column_fieldsObject



13
14
15
# File 'lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb', line 13

def test__file_column_fields
  assert_equal(1, @model.class.file_column_fields.length)
end

#test__just_uploaded__shouldnt_deleteObject



37
38
39
40
41
# File 'lib/active_scaffold/bridges/file_column/test/functional/file_column_keep_test.rb', line 37

def test__just_uploaded__shouldnt_delete
  @model.band_image_just_uploaded = true
  @model.delete_band_image = 'true'
  refute_nil(@model.band_image)
end