Sha256: da78ae79791f981f6f6456383941109e0b667a62cf1d233c0f21258d9284746a

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

require File.dirname(__FILE__) + '/../../../../spec/spec_helper'
require 'pathname'

plugin_spec_dir = File.dirname(__FILE__)
ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + "/debug.log")

load(File.dirname(__FILE__) + '/schema.rb')

Spec::Runner.configure do |config|
  # have to set Test::Unit::TestCase.fixture_path until RSpec is fixed
  # (config.fixture_path seems to be ignored w/ Rails 2.2.2/Rspec 1.1.12)
  config.fixture_path = Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), 'fixtures/')
  
  # remove files created from previous spec run, happens before instead of
  # after so you can view them after you run the specs
  FileUtils.rm_rf(File.join(File.dirname(__FILE__), 'output'))
end

def upload(file, type='image/jpg')
  fixture_file_upload file, type
end

class Attachment < ActiveRecord::Base
  is_uploadable :file_system_path => File.join(File.dirname(__FILE__), 'output')
end

class Image < ActiveRecord::Base
  is_image :file_system_path => File.join(File.dirname(__FILE__), 'output')
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
citrusbyte-milton-0.2.3 spec/spec_helper.rb
citrusbyte-milton-0.2.4 spec/spec_helper.rb