Skip to content

Commit cdf6ca5

Browse files
author
Sam Phippen
committed
Cops
1 parent 113879b commit cdf6ca5

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

lib/rspec/rails/configuration.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,7 @@ def filter_rails_from_backtrace!
9898
end
9999
end
100100

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
101+
add_test_type_configurations(config)
108102

109103
if defined?(::Rails::Controller::Testing)
110104
[:controller, :view, :request].each do |type|
@@ -125,4 +119,14 @@ def filter_rails_from_backtrace!
125119

126120
initialize_configuration RSpec.configuration
127121
end
122+
123+
def self.add_test_type_configurations(config)
124+
config.include RSpec::Rails::ControllerExampleGroup, :type => :controller
125+
config.include RSpec::Rails::HelperExampleGroup, :type => :helper
126+
config.include RSpec::Rails::ModelExampleGroup, :type => :model
127+
config.include RSpec::Rails::RequestExampleGroup, :type => :request
128+
config.include RSpec::Rails::RoutingExampleGroup, :type => :routing
129+
config.include RSpec::Rails::ViewExampleGroup, :type => :view
130+
config.include RSpec::Rails::FeatureExampleGroup, :type => :feature
131+
end
128132
end

lib/rspec/rails/example/view_example_group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _include_controller_helpers
160160

161161
path_params_to_merge = {}
162162
path_params_to_merge[:controller] = _controller_path
163-
path_params_to_merge[:action ] = _inferred_action unless _inferred_action =~ /^_/
163+
path_params_to_merge[:action] = _inferred_action unless _inferred_action =~ /^_/
164164

165165
path_params = controller.request.path_parameters
166166

0 commit comments

Comments
 (0)