Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

root/trunk/actionpack/test/controller/addresses_render_test.rb

Revision 8564, 1.0 kB (checked in by bitsweat, 1 year ago)

require abstract_unit directly since test is in load path

Line 
1 require 'abstract_unit'
2
3 class Address
4
5   def Address.count(conditions = nil, join = nil)
6     nil
7   end
8
9   def Address.find_all(arg1, arg2, arg3, arg4)
10     []
11   end
12
13   def self.find(*args)
14     []
15   end
16 end
17
18 class AddressesTestController < ActionController::Base
19   def self.controller_name; "addresses"; end
20   def self.controller_path; "addresses"; end
21 end
22
23 AddressesTestController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
24
25 class AddressesTest < Test::Unit::TestCase
26   def setup
27     @controller = AddressesTestController.new
28
29     # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
30     # a more accurate simulation of what happens in "real life".
31     @controller.logger = Logger.new(nil)
32
33     @request    = ActionController::TestRequest.new
34     @response   = ActionController::TestResponse.new
35
36     @request.host = "www.nextangle.com"
37   end
38
39   def test_list
40     get :list
41     assert_equal "We only need to get this far!", @response.body.chomp
42   end
43 end
Note: See TracBrowser for help on using the browser.