File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
module RSpec
2
2
module Rails
3
+ # Raises an error if the user tries to call integration test helpers.
4
+ # If the helpers are available then this module will be ignored.
5
+ module IntegrationHelperWarnings
6
+ extend ActiveSupport ::Concern
7
+ [ :assert_select , :url_for , :url_options ] . each do |name |
8
+ define_method ( name ) { |*| raise "you must upgrade Rails to call #{ name } " }
9
+ end
10
+ end
11
+
3
12
# @api public
4
13
# Container class for request spec functionality.
5
14
module RequestExampleGroup
@@ -11,6 +20,12 @@ module RequestExampleGroup
11
20
include RSpec ::Rails ::Matchers ::RenderTemplate
12
21
include ActionController ::TemplateAssertions
13
22
23
+ begin
24
+ include ActionDispatch ::IntegrationTest ::Behavior
25
+ rescue NameError
26
+ include IntegrationHelperWarnings
27
+ end
28
+
14
29
# Delegates to `Rails.application`.
15
30
def app
16
31
::Rails . application
You can’t perform that action at this time.
0 commit comments