@@ -36,6 +36,16 @@ class Configuration
36
36
:feature => %w[ spec features ]
37
37
}
38
38
39
+ def self . add_test_type_configurations ( config )
40
+ config . include RSpec ::Rails ::ControllerExampleGroup , :type => :controller
41
+ config . include RSpec ::Rails ::HelperExampleGroup , :type => :helper
42
+ config . include RSpec ::Rails ::ModelExampleGroup , :type => :model
43
+ config . include RSpec ::Rails ::RequestExampleGroup , :type => :request
44
+ config . include RSpec ::Rails ::RoutingExampleGroup , :type => :routing
45
+ config . include RSpec ::Rails ::ViewExampleGroup , :type => :view
46
+ config . include RSpec ::Rails ::FeatureExampleGroup , :type => :feature
47
+ end
48
+
39
49
# @private
40
50
def self . initialize_configuration ( config )
41
51
config . backtrace_exclusion_patterns << /vendor\/ /
@@ -98,13 +108,7 @@ def filter_rails_from_backtrace!
98
108
end
99
109
end
100
110
101
- config . include RSpec ::Rails ::ControllerExampleGroup , :type => :controller
102
- config . include RSpec ::Rails ::HelperExampleGroup , :type => :helper
103
- config . include RSpec ::Rails ::ModelExampleGroup , :type => :model
104
- config . include RSpec ::Rails ::RequestExampleGroup , :type => :request
105
- config . include RSpec ::Rails ::RoutingExampleGroup , :type => :routing
106
- config . include RSpec ::Rails ::ViewExampleGroup , :type => :view
107
- config . include RSpec ::Rails ::FeatureExampleGroup , :type => :feature
111
+ add_test_type_configurations ( config )
108
112
109
113
if defined? ( ::Rails ::Controller ::Testing )
110
114
[ :controller , :view , :request ] . each do |type |
@@ -125,4 +129,5 @@ def filter_rails_from_backtrace!
125
129
126
130
initialize_configuration RSpec . configuration
127
131
end
132
+
128
133
end
0 commit comments