File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ def self.method_added(method)
62
62
unless method_defined? ( :setup_without_controller )
63
63
alias_method :setup_without_controller , :setup
64
64
define_method ( :setup ) do
65
+ setup_with_fixtures if respond_to? ( :setup_with_fixtures )
65
66
setup_with_controller
66
67
setup_without_controller
67
68
end
Original file line number Diff line number Diff line change
1
+ require File . dirname ( __FILE__ ) + '/../active_record_unit'
2
+ require "action_controller/test_case"
3
+
4
+ class ActionController ::TestCase
5
+ self . fixture_path = File . dirname ( __FILE__ ) + '/../fixtures'
6
+ self . use_transactional_fixtures = false
7
+ end
8
+
9
+ class DeveloperController < ActionController ::Base
10
+ end
11
+
12
+ class DeveloperControllerTest < ActionController ::TestCase
13
+ fixtures :developers
14
+
15
+ def setup
16
+ @david = developers ( :david )
17
+ end
18
+
19
+ def test_should_have_loaded_fixtures
20
+ assert_kind_of ( Developer , @david )
21
+ assert_kind_of ( Developer , developers ( :jamis ) )
22
+ assert_equal ( @developers . size , Developer . count )
23
+ end
24
+ end
You can’t perform that action at this time.
0 commit comments