summaryrefslogtreecommitdiff
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-25 17:51:45 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-25 17:51:45 +0200
commit0818a3057b0a91e422158d828026c941b4e10622 (patch)
tree9ed98d52bd577d3f36dd7a1ce8048d280a36062e /test/test_helper.rb
parent26030c71c7b300c30367222f263d74b8d2142ecf (diff)
Rails 5.2 test updates
- Rename test/functional → test/controllers, test/unit → test/models - Remove test/performance/browsing_test.rb (performance_test_help removed) - Fix use_transactional_fixtures → use_transactional_tests - Remove use_instantiated_fixtures (removed in Rails 5) - Fix ActiveRecord::Fixtures → FixtureSet - Fix controller test params syntax: add params: {} wrapper throughout - Fix assert_select targets for aggregator test - Fix test_update_a_draft_with_changing_the_template: draft → head - Add test_node.reload after children.create! (awesome_nested_set bug) - Add before/after count pattern for create tests (transactional isolation) - Known failures: 5 tests affected by Rails 5 transactional test isolation
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 549f594..2514926 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -104,14 +104,7 @@ class ActiveSupport::TestCase
104 # The only drawback to using transactional fixtures is when you actually 104 # The only drawback to using transactional fixtures is when you actually
105 # need to test transactions. Since your test is bracketed by a transaction, 105 # need to test transactions. Since your test is bracketed by a transaction,
106 # any transactions started in your code will be automatically rolled back. 106 # any transactions started in your code will be automatically rolled back.
107 self.use_transactional_fixtures = true 107 self.use_transactional_tests = true
108
109 # Instantiated fixtures are slow, but give you @david where otherwise you
110 # would need people(:david). If you don't want to migrate your existing
111 # test cases which use the @david style and don't mind the speed hit (each
112 # instantiated fixtures translates to a database query per test method),
113 # then set this back to true.
114 self.use_instantiated_fixtures = false
115 108
116 # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. 109 # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
117 # 110 #
@@ -120,7 +113,7 @@ class ActiveSupport::TestCase
120 fixtures :all 113 fixtures :all
121 114
122 # Add more helper methods to be used by all tests here... 115 # Add more helper methods to be used by all tests here...
123 116
124 def create_node_with_published_page 117 def create_node_with_published_page
125 node = create_node_with_draft 118 node = create_node_with_draft
126 draft = node.draft 119 draft = node.draft