Sha256: 420722941d2f04fa3927c239a672bd9c1526a15c9c1bfcd3e4655a88af4e49b4
Contents?: true
Size: 1.23 KB
Versions: 6
Compression:
Stored size: 1.23 KB
Contents
require 'test_helper' require File.expand_path('../mock_model.rb', __dir__) require File.expand_path('../../file_column_helpers.rb', __dir__) class DeleteFileColumnTest < Minitest::Test 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 def test__file_column_fields assert_equal(1, @model.class.file_column_fields.length) end def test__delete_band_image__boolean__should_delete @model.delete_band_image = true assert_nil @model.band_image end def test__delete_band_image__string__should_delete @model.delete_band_image = 'true' assert_nil @model.band_image end def test__delete_band_image__boolean_false__shouldnt_delete @model.delete_band_image = false assert_not_nil @model.band_image end def test__delete_band_image__string_false__shouldnt_delete @model.delete_band_image = 'false' assert_not_nil @model.band_image end def test__just_uploaded__shouldnt_delete @model.band_image_just_uploaded = true @model.delete_band_image = 'true' assert_not_nil(@model.band_image) end end
Version data entries
6 entries across 6 versions & 1 rubygems