@@ -27,29 +27,9 include ObjectHelpers | |||||
27 | class ActiveSupport::TestCase |
|
27 | class ActiveSupport::TestCase | |
28 | include ActionDispatch::TestProcess |
|
28 | include ActionDispatch::TestProcess | |
29 |
|
29 | |||
30 | # Transactional fixtures accelerate your tests by wrapping each test method |
|
|||
31 | # in a transaction that's rolled back on completion. This ensures that the |
|
|||
32 | # test database remains unchanged so your fixtures don't have to be reloaded |
|
|||
33 | # between every test method. Fewer database queries means faster tests. |
|
|||
34 | # |
|
|||
35 | # Read Mike Clark's excellent walkthrough at |
|
|||
36 | # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting |
|
|||
37 | # |
|
|||
38 | # Every Active Record database supports transactions except MyISAM tables |
|
|||
39 | # in MySQL. Turn off transactional fixtures in this case; however, if you |
|
|||
40 | # don't care one way or the other, switching from MyISAM to InnoDB tables |
|
|||
41 | # is recommended. |
|
|||
42 | self.use_transactional_fixtures = true |
|
30 | self.use_transactional_fixtures = true | |
43 |
|
||||
44 | # Instantiated fixtures are slow, but give you @david where otherwise you |
|
|||
45 | # would need people(:david). If you don't want to migrate your existing |
|
|||
46 | # test cases which use the @david style and don't mind the speed hit (each |
|
|||
47 | # instantiated fixtures translates to a database query per test method), |
|
|||
48 | # then set this back to true. |
|
|||
49 | self.use_instantiated_fixtures = false |
|
31 | self.use_instantiated_fixtures = false | |
50 |
|
32 | |||
51 | # Add more helper methods to be used by all tests here... |
|
|||
52 |
|
||||
53 | def log_user(login, password) |
|
33 | def log_user(login, password) | |
54 | User.anonymous |
|
34 | User.anonymous | |
55 | get "/login" |
|
35 | get "/login" |
General Comments 0
You need to be logged in to leave comments.
Login now