Sha256: cfd2986cd4c59a0598dee5f6d1ffb61cc6bf3e0c9aacaa863d774e5b5b553583

Contents?: true

Size: 604 Bytes

Versions: 14

Compression:

Stored size: 604 Bytes

Contents

require File.dirname(__FILE__) + '/../../test/test_helper'

class FleximageFileUploadFromStringsTest < Test::Unit::TestCase
  def test_should_accept_file_as_string
    data = files(:photo).read
    
    p = PhotoBare.new
    p.image_file_string = data
    p.save
    assert p.save, 'Record expected to be allowed to save'
    assert p.has_image?
  end
  
  def test_should_accept_file_as_base64
    data = Base64.encode64(files(:photo).read)
    
    p = PhotoBare.new
    p.image_file_base64 = data
    p.save
    assert p.save, 'Record expected to be allowed to save'
    assert p.has_image?
  end
end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
tvdeyen-fleximage-1.2.0 test/unit/file_upload_from_strings_test.rb
tvdeyen-fleximage-1.1.1 test/unit/file_upload_from_strings_test.rb
tvdeyen-fleximage-1.0.9 test/unit/file_upload_from_strings_test.rb
tvdeyen-fleximage-1.0.8 test/unit/file_upload_from_strings_test.rb
tvdeyen-fleximage-1.0.7 test/unit/file_upload_from_strings_test.rb
robinboening-fleximage-1.0.6 test/unit/file_upload_from_strings_test.rb
robinboening-fleximage-1.0.4 test/unit/file_upload_from_strings_test.rb
tvdeyen-fleximage-1.0.5 test/unit/file_upload_from_strings_test.rb
fleximage-1.0.4 test/unit/file_upload_from_strings_test.rb
dougmcbride-fleximage-1.0.3 test/unit/file_upload_from_strings_test.rb
fleximage-1.0.3 test/unit/file_upload_from_strings_test.rb
fleximage-1.0.2 test/unit/file_upload_from_strings_test.rb
fleximage-1.0.1 test/unit/file_upload_from_strings_test.rb
fleximage-1.0.0 test/unit/file_upload_from_strings_test.rb