2 def self.report_location(path)
3 [RAILS_ROOT + '/', 'vendor/plugins/'].each { |part| path.sub! part, ''}
5 location, subject = path.first, path.last
6 if subject.sub! '.rb', ''
7 subject = subject.classify
9 subject.sub! '.html.erb', ''
11 "#{subject} (from #{location})"
14 def self.view_path_for path
15 [RAILS_ROOT + '/', 'vendor/plugins/', '.html.erb'].each { |part| path.sub! part, ''}
16 parts = path.split('/')
17 parts[(parts.index('views')+1)..-1].join('/')
21 class Test::Unit::TestCase
22 # Add more helper methods to be used by all tests here...
23 def get_action_on_controller(*args)
29 def with_controller(controller, namespace = nil)
30 classname = controller.to_s.classify + 'Controller'
31 classname = namespace.to_s.classify + '::' + classname unless namespace.nil?
32 @controller = classname.constantize.new
35 def assert_response_body(expected)
36 assert_equal expected, @response.body
40 # Because we're testing this behaviour, we actually want these features on!
41 Engines.disable_application_view_loading = false
42 Engines.disable_application_code_loading = false