summaryrefslogtreecommitdiff
path: root/test/test_helper.rb
blob: 7959ddb56c454a07d8a5b5ca423d919102ca4674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

require 'mocha/setup'

# Load support files from toplevel
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

# Load support files from all engines
Dir["#{File.dirname(__FILE__)}/../engines/*/test/support/**/*.rb"].each { |f| require f }

class ActiveSupport::TestCase
  # Add more helper methods to be used by all tests here...

  protected

  def logfile_path
    Rails.root + 'tmp' + "#{self.class.name.underscore}.#{__name__}.log"
  end

  def screenshot_path
    Rails.root + 'tmp' + "#{self.class.name.underscore}.#{__name__}.png"
  end

  def file_path(name)
    File.join(Rails.root, 'test', 'files', name)
  end

  require 'i18n/missing_translations'
  at_exit { I18n.missing_translations.dump }
end