Sha256: 36d2ec549ed6bceb581a3ab47c11a3357ac3808d4104505712f1692464eb6e81

Contents?: true

Size: 659 Bytes

Versions: 2

Compression:

Stored size: 659 Bytes

Contents

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

class FleximageImageDirectoryOptionTest < Test::Unit::TestCase
  def test_should_store_in_default_image_directory
    p = PhotoBare.create(:image_file => files(:photo))
    assert_match %r{public/uploads/\d+/\d+/\d+/\d+}, p.file_path
    assert File.exists?(p.file_path)
  end
  
  def test_should_set_image_directory
    PhotoBare.image_directory = 'public/uploads/foo'
    p = PhotoBare.create(:image_file => files(:photo))
    assert_match %r{public/uploads/foo/\d+/\d+/\d+/\d+}, p.file_path
    assert File.exists?(p.file_path)
  ensure
    PhotoBare.image_directory = 'public/uploads'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fleximage-1.0.1 test/unit/image_directory_option_test.rb
fleximage-1.0.0 test/unit/image_directory_option_test.rb