##// END OF EJS Templates
replace RAILS_ROOT to Rails.root in test/test_helper.rb....
Toshi MARUYAMA -
r5961:d893bdcd768e
parent child
Show More
@@ -78,11 +78,13 class ActiveSupport::TestCase
78
78
79 # Use a temporary directory for attachment related tests
79 # Use a temporary directory for attachment related tests
80 def set_tmp_attachments_directory
80 def set_tmp_attachments_directory
81 Dir.mkdir "#{RAILS_ROOT}/tmp/test" unless File.directory?("#{RAILS_ROOT}/tmp/test")
81 Dir.mkdir "#{Rails.root}/tmp/test" unless File.directory?("#{Rails.root}/tmp/test")
82 Dir.mkdir "#{RAILS_ROOT}/tmp/test/attachments" unless File.directory?("#{RAILS_ROOT}/tmp/test/attachments")
82 unless File.directory?("#{Rails.root}/tmp/test/attachments")
83 Attachment.storage_path = "#{RAILS_ROOT}/tmp/test/attachments"
83 Dir.mkdir "#{Rails.root}/tmp/test/attachments"
84 end
85 Attachment.storage_path = "#{Rails.root}/tmp/test/attachments"
84 end
86 end
85
87
86 def with_settings(options, &block)
88 def with_settings(options, &block)
87 saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].dup; h}
89 saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].dup; h}
88 options.each {|k, v| Setting[k] = v}
90 options.each {|k, v| Setting[k] = v}
General Comments 0
You need to be logged in to leave comments. Login now