File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
generators/rspec/install/templates/spec Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 42
42
# instead of true.
43
43
config.use_transactional_fixtures = true
44
44
45
+ # You can uncomment this line to turn off active_record support entirely.
46
+ # config.use_active_record = false
47
+
48
+ <% else -%>
49
+ # Remove this line to enable support for active_record
50
+ config.use_active_record = false
51
+
45
52
<% end -%>
46
53
# RSpec Rails can automatically mix in different behaviours to your tests
47
54
# based on their file location, for example enabling you to call `get` and
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ def self.initialize_configuration(config)
64
64
config . add_setting :infer_base_class_for_anonymous_controllers , default : true
65
65
66
66
# fixture support
67
+ config . add_setting :use_active_record , default : true
67
68
config . add_setting :use_transactional_fixtures , alias_with : :use_transactional_examples
68
69
config . add_setting :use_instantiated_fixtures
69
70
config . add_setting :global_fixtures
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ module FixtureSupport
10
10
include ActiveRecord ::TestFixtures
11
11
12
12
included do
13
+ setup if RSpec . configuration . use_active_record?
14
+ end
15
+
16
+ def self . setup
13
17
self . fixture_path = RSpec . configuration . fixture_path
14
18
if ::Rails ::VERSION ::STRING > '5'
15
19
self . use_transactional_tests = RSpec . configuration . use_transactional_fixtures
You can’t perform that action at this time.
0 commit comments