comparison .svn/pristine/33/3396ee85e7860d58bce2840b1f00fae7a535409f.svn-base @ 909:cbb26bc654de redmine-1.3

Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author Chris Cannam
date Fri, 24 Feb 2012 19:09:32 +0000
parents
children
comparison
equal deleted inserted replaced
908:c6c2cbd0afee 909:cbb26bc654de
1 module TestHelper
2 def self.report_location(path)
3 [RAILS_ROOT + '/', 'vendor/plugins/'].each { |part| path.sub! part, ''}
4 path = path.split('/')
5 location, subject = path.first, path.last
6 if subject.sub! '.rb', ''
7 subject = subject.classify
8 else
9 subject.sub! '.html.erb', ''
10 end
11 "#{subject} (from #{location})"
12 end
13
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('/')
18 end
19 end
20
21 class Test::Unit::TestCase
22 # Add more helper methods to be used by all tests here...
23 def get_action_on_controller(*args)
24 action = args.shift
25 with_controller *args
26 get action
27 end
28
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
33 end
34
35 def assert_response_body(expected)
36 assert_equal expected, @response.body
37 end
38 end
39
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