Sha256: 32be511459c8d8bc1c0b8b7b72654f3324b54df749d81b919440e39ba37be73f

Contents?: true

Size: 773 Bytes

Versions: 12

Compression:

Stored size: 773 Bytes

Contents

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

class FleximageImageDirectoryOptionTest < Test::Unit::TestCase
  def test_should_store_in_default_image_directory
    PhotoBare.use_creation_date_based_directories = true
    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.use_creation_date_based_directories = true
    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

12 entries across 12 versions & 4 rubygems

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