actionpack 6.0.0.beta2 → 6.0.2.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +116 -3
- data/README.rdoc +2 -1
- data/lib/action_controller.rb +4 -1
- data/lib/action_controller/metal.rb +3 -3
- data/lib/action_controller/metal/exceptions.rb +1 -1
- data/lib/action_controller/metal/helpers.rb +1 -1
- data/lib/action_controller/metal/live.rb +1 -1
- data/lib/action_controller/metal/mime_responds.rb +1 -1
- data/lib/action_controller/metal/params_wrapper.rb +2 -2
- data/lib/action_controller/metal/renderers.rb +4 -4
- data/lib/action_controller/metal/rendering.rb +1 -1
- data/lib/action_controller/metal/request_forgery_protection.rb +2 -2
- data/lib/action_controller/metal/strong_parameters.rb +5 -11
- data/lib/action_controller/renderer.rb +2 -2
- data/lib/action_controller/template_assertions.rb +1 -1
- data/lib/action_controller/test_case.rb +3 -2
- data/lib/action_dispatch.rb +1 -1
- data/lib/action_dispatch/http/content_security_policy.rb +20 -9
- data/lib/action_dispatch/http/mime_negotiation.rb +5 -0
- data/lib/action_dispatch/http/mime_type.rb +13 -1
- data/lib/action_dispatch/http/request.rb +2 -1
- data/lib/action_dispatch/http/response.rb +27 -7
- data/lib/action_dispatch/journey/formatter.rb +2 -2
- data/lib/action_dispatch/journey/path/pattern.rb +6 -1
- data/lib/action_dispatch/journey/route.rb +5 -4
- data/lib/action_dispatch/journey/routes.rb +0 -1
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +39 -0
- data/lib/action_dispatch/middleware/cookies.rb +7 -3
- data/lib/action_dispatch/middleware/debug_exceptions.rb +8 -2
- data/lib/action_dispatch/middleware/debug_view.rb +12 -0
- data/lib/action_dispatch/middleware/exception_wrapper.rb +1 -0
- data/lib/action_dispatch/middleware/public_exceptions.rb +6 -2
- data/lib/action_dispatch/middleware/remote_ip.rb +3 -3
- data/lib/action_dispatch/middleware/session/cookie_store.rb +4 -3
- data/lib/action_dispatch/middleware/stack.rb +34 -2
- data/lib/action_dispatch/middleware/templates/rescues/_actions.html.erb +13 -0
- data/lib/action_dispatch/middleware/templates/rescues/_actions.text.erb +0 -0
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +3 -1
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +6 -2
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +3 -0
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +2 -0
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +4 -0
- data/lib/action_dispatch/railtie.rb +6 -2
- data/lib/action_dispatch/routing.rb +4 -4
- data/lib/action_dispatch/routing/mapper.rb +28 -13
- data/lib/action_dispatch/routing/route_set.rb +13 -15
- data/lib/action_dispatch/system_test_case.rb +22 -3
- data/lib/action_dispatch/system_testing/browser.rb +23 -0
- data/lib/action_dispatch/system_testing/driver.rb +2 -0
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +2 -1
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +7 -6
- data/lib/action_dispatch/testing/assertions.rb +1 -1
- data/lib/action_dispatch/testing/request_encoder.rb +2 -2
- data/lib/action_dispatch/testing/test_response.rb +1 -1
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +20 -15
- data/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +0 -26
File without changes
|
@@ -6,7 +6,9 @@
|
|
6
6
|
<% end %>
|
7
7
|
|
8
8
|
<h2 style="margin-top: 30px">Request</h2>
|
9
|
-
|
9
|
+
<% if params_valid? %>
|
10
|
+
<p><b>Parameters</b>:</p> <pre><%= debug_params(@request.filtered_parameters) %></pre>
|
11
|
+
<% end %>
|
10
12
|
|
11
13
|
<div class="details">
|
12
14
|
<div class="summary"><a href="#" onclick="return toggleSessionDump()">Toggle session dump</a></div>
|
@@ -1,14 +1,18 @@
|
|
1
1
|
<header>
|
2
2
|
<h1>
|
3
3
|
<%= @exception.class.to_s %>
|
4
|
-
<% if @request.parameters['controller'] %>
|
4
|
+
<% if params_valid? && @request.parameters['controller'] %>
|
5
5
|
in <%= @request.parameters['controller'].camelize %>Controller<% if @request.parameters['action'] %>#<%= @request.parameters['action'] %><% end %>
|
6
6
|
<% end %>
|
7
7
|
</h1>
|
8
8
|
</header>
|
9
9
|
|
10
10
|
<div id="container">
|
11
|
-
<h2
|
11
|
+
<h2>
|
12
|
+
<%= h @exception.message %>
|
13
|
+
|
14
|
+
<%= render "rescues/actions", exception: @exception, request: @request %>
|
15
|
+
</h2>
|
12
16
|
|
13
17
|
<%= render "rescues/source", source_extracts: @source_extracts, show_source_idx: @show_source_idx, error_index: 0 %>
|
14
18
|
<%= render "rescues/trace", traces: @traces, trace_to_show: @trace_to_show, error_index: 0 %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= @exception.class.to_s %><%
|
2
|
-
if @request.parameters['controller']
|
2
|
+
if params_valid? && @request.parameters['controller']
|
3
3
|
%> in <%= @request.parameters['controller'].camelize %>Controller<% if @request.parameters['action'] %>#<%= @request.parameters['action'] %><% end %>
|
4
4
|
<% end %>
|
5
5
|
|
@@ -13,6 +13,9 @@
|
|
13
13
|
<% if defined?(ActiveStorage) && @exception.message.match?(%r{#{ActiveStorage::Blob.table_name}|#{ActiveStorage::Attachment.table_name}}) %>
|
14
14
|
<br />To resolve this issue run: rails active_storage:install
|
15
15
|
<% end %>
|
16
|
+
<% if defined?(ActionMailbox) && @exception.message.match?(%r{#{ActionMailbox::InboundEmail.table_name}}) %>
|
17
|
+
<br />To resolve this issue run: rails action_mailbox:install
|
18
|
+
<% end %>
|
16
19
|
</h2>
|
17
20
|
|
18
21
|
<%= render "rescues/source", source_extracts: @source_extracts, show_source_idx: @show_source_idx %>
|
@@ -6,6 +6,8 @@
|
|
6
6
|
<%= @exception.message %>
|
7
7
|
<% if defined?(ActiveStorage) && @exception.message.match?(%r{#{ActiveStorage::Blob.table_name}|#{ActiveStorage::Attachment.table_name}}) %>
|
8
8
|
To resolve this issue run: rails active_storage:install
|
9
|
+
<% if defined?(ActionMailbox) && @exception.message.match?(%r{#{ActionMailbox::InboundEmail.table_name}}) %>
|
10
|
+
To resolve this issue run: rails action_mailbox:install
|
9
11
|
<% end %>
|
10
12
|
|
11
13
|
<%= render template: "rescues/_source" %>
|
@@ -23,6 +23,7 @@ module ActionDispatch
|
|
23
23
|
config.action_dispatch.use_authenticated_cookie_encryption = false
|
24
24
|
config.action_dispatch.use_cookies_with_metadata = false
|
25
25
|
config.action_dispatch.perform_deep_munge = true
|
26
|
+
config.action_dispatch.return_only_media_type_on_content_type = true
|
26
27
|
|
27
28
|
config.action_dispatch.default_headers = {
|
28
29
|
"X-Frame-Options" => "SAMEORIGIN",
|
@@ -41,8 +42,11 @@ module ActionDispatch
|
|
41
42
|
ActionDispatch::Http::URL.tld_length = app.config.action_dispatch.tld_length
|
42
43
|
ActionDispatch::Request.ignore_accept_header = app.config.action_dispatch.ignore_accept_header
|
43
44
|
ActionDispatch::Request::Utils.perform_deep_munge = app.config.action_dispatch.perform_deep_munge
|
44
|
-
|
45
|
-
|
45
|
+
ActiveSupport.on_load(:action_dispatch_response) do
|
46
|
+
self.default_charset = app.config.action_dispatch.default_charset || app.config.encoding
|
47
|
+
self.default_headers = app.config.action_dispatch.default_headers
|
48
|
+
self.return_only_media_type_on_content_type = app.config.action_dispatch.return_only_media_type_on_content_type
|
49
|
+
end
|
46
50
|
|
47
51
|
ActionDispatch::ExceptionWrapper.rescue_responses.merge!(config.action_dispatch.rescue_responses)
|
48
52
|
ActionDispatch::ExceptionWrapper.rescue_templates.merge!(config.action_dispatch.rescue_templates)
|
@@ -210,8 +210,8 @@ module ActionDispatch
|
|
210
210
|
# === +assert_routing+
|
211
211
|
#
|
212
212
|
# def test_movie_route_properly_splits
|
213
|
-
#
|
214
|
-
#
|
213
|
+
# opts = {controller: "plugin", action: "checkout", id: "2"}
|
214
|
+
# assert_routing "plugin/checkout/2", opts
|
215
215
|
# end
|
216
216
|
#
|
217
217
|
# +assert_routing+ lets you test whether or not the route properly resolves into options.
|
@@ -219,8 +219,8 @@ module ActionDispatch
|
|
219
219
|
# === +assert_recognizes+
|
220
220
|
#
|
221
221
|
# def test_route_has_options
|
222
|
-
#
|
223
|
-
#
|
222
|
+
# opts = {controller: "plugin", action: "show", id: "12"}
|
223
|
+
# assert_recognizes opts, "/plugins/show/12"
|
224
224
|
# end
|
225
225
|
#
|
226
226
|
# Note the subtle difference between the two: +assert_routing+ tests that
|
@@ -70,17 +70,17 @@ module ActionDispatch
|
|
70
70
|
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
|
71
71
|
OPTIONAL_FORMAT_REGEX = %r{(?:\(\.:format\)+|\.:format|/)\Z}
|
72
72
|
|
73
|
-
attr_reader :requirements, :defaults
|
74
|
-
|
75
|
-
attr_reader :required_defaults, :ast
|
73
|
+
attr_reader :requirements, :defaults, :to, :default_controller,
|
74
|
+
:default_action, :required_defaults, :ast, :scope_options
|
76
75
|
|
77
76
|
def self.build(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, options)
|
78
77
|
options = scope[:options].merge(options) if scope[:options]
|
79
78
|
|
80
79
|
defaults = (scope[:defaults] || {}).dup
|
81
80
|
scope_constraints = scope[:constraints] || {}
|
81
|
+
scope_options = scope[:options] || {}
|
82
82
|
|
83
|
-
new set, ast, defaults, controller, default_action, scope[:module], to, formatted, scope_constraints, scope[:blocks] || [], via, options_constraints, anchor, options
|
83
|
+
new set, ast, defaults, controller, default_action, scope[:module], to, formatted, scope_constraints, scope_options, scope[:blocks] || [], via, options_constraints, anchor, options
|
84
84
|
end
|
85
85
|
|
86
86
|
def self.check_via(via)
|
@@ -111,17 +111,18 @@ module ActionDispatch
|
|
111
111
|
format != false && path !~ OPTIONAL_FORMAT_REGEX
|
112
112
|
end
|
113
113
|
|
114
|
-
def initialize(set, ast, defaults, controller, default_action, modyoule, to, formatted, scope_constraints, blocks, via, options_constraints, anchor, options)
|
114
|
+
def initialize(set, ast, defaults, controller, default_action, modyoule, to, formatted, scope_constraints, scope_options, blocks, via, options_constraints, anchor, options)
|
115
115
|
@defaults = defaults
|
116
116
|
@set = set
|
117
117
|
|
118
|
-
@to = to
|
119
|
-
@default_controller = controller
|
120
|
-
@default_action = default_action
|
118
|
+
@to = intern(to)
|
119
|
+
@default_controller = intern(controller)
|
120
|
+
@default_action = intern(default_action)
|
121
121
|
@ast = ast
|
122
122
|
@anchor = anchor
|
123
123
|
@via = via
|
124
124
|
@internal = options.delete(:internal)
|
125
|
+
@scope_options = scope_options
|
125
126
|
|
126
127
|
path_params = ast.find_all(&:symbol?).map(&:to_sym)
|
127
128
|
|
@@ -161,7 +162,7 @@ module ActionDispatch
|
|
161
162
|
|
162
163
|
def make_route(name, precedence)
|
163
164
|
Journey::Route.new(name, application, path, conditions, required_defaults,
|
164
|
-
defaults, request_method, precedence, @internal)
|
165
|
+
defaults, request_method, precedence, scope_options, @internal)
|
165
166
|
end
|
166
167
|
|
167
168
|
def application
|
@@ -222,6 +223,10 @@ module ActionDispatch
|
|
222
223
|
private :build_path
|
223
224
|
|
224
225
|
private
|
226
|
+
def intern(object)
|
227
|
+
object.is_a?(String) ? -object : object
|
228
|
+
end
|
229
|
+
|
225
230
|
def add_wildcard_options(options, formatted, path_ast)
|
226
231
|
# Add a constraint for wildcard route to make it non-greedy and match the
|
227
232
|
# optional format part of the route by default.
|
@@ -336,7 +341,7 @@ module ActionDispatch
|
|
336
341
|
end
|
337
342
|
|
338
343
|
def split_to(to)
|
339
|
-
if /#/.match?(to)
|
344
|
+
if to && /#/.match?(to)
|
340
345
|
to.split("#")
|
341
346
|
else
|
342
347
|
[]
|
@@ -345,7 +350,7 @@ module ActionDispatch
|
|
345
350
|
|
346
351
|
def add_controller_module(controller, modyoule)
|
347
352
|
if modyoule && !controller.is_a?(Regexp)
|
348
|
-
if
|
353
|
+
if controller && controller.start_with?("/")
|
349
354
|
controller[1..-1]
|
350
355
|
else
|
351
356
|
[modyoule, controller].compact.join("/")
|
@@ -1141,6 +1146,10 @@ module ActionDispatch
|
|
1141
1146
|
attr_reader :controller, :path, :param
|
1142
1147
|
|
1143
1148
|
def initialize(entities, api_only, shallow, options = {})
|
1149
|
+
if options[:param].to_s.include?(":")
|
1150
|
+
raise ArgumentError, ":param option can't contain colons"
|
1151
|
+
end
|
1152
|
+
|
1144
1153
|
@name = entities.to_s
|
1145
1154
|
@path = (options[:path] || @name).to_s
|
1146
1155
|
@controller = (options[:controller] || @name).to_s
|
@@ -1398,6 +1407,8 @@ module ActionDispatch
|
|
1398
1407
|
# as a comment on a blog post like <tt>/posts/a-long-permalink/comments/1234</tt>
|
1399
1408
|
# to be shortened to just <tt>/comments/1234</tt>.
|
1400
1409
|
#
|
1410
|
+
# Set <tt>shallow: false</tt> on a child resource to ignore a parent's shallow parameter.
|
1411
|
+
#
|
1401
1412
|
# [:shallow_path]
|
1402
1413
|
# Prefixes nested shallow routes with the specified path.
|
1403
1414
|
#
|
@@ -1440,6 +1451,9 @@ module ActionDispatch
|
|
1440
1451
|
# Allows you to specify the default value for optional +format+
|
1441
1452
|
# segment or disable it by supplying +false+.
|
1442
1453
|
#
|
1454
|
+
# [:param]
|
1455
|
+
# Allows you to override the default param name of +:id+ in the URL.
|
1456
|
+
#
|
1443
1457
|
# === Examples
|
1444
1458
|
#
|
1445
1459
|
# # routes call <tt>Admin::PostsController</tt>
|
@@ -1665,7 +1679,8 @@ module ActionDispatch
|
|
1665
1679
|
return true
|
1666
1680
|
end
|
1667
1681
|
|
1668
|
-
if options
|
1682
|
+
if options[:shallow]
|
1683
|
+
options.delete(:shallow)
|
1669
1684
|
shallow do
|
1670
1685
|
send(method, resources.pop, options, &block)
|
1671
1686
|
end
|
@@ -2059,7 +2074,7 @@ module ActionDispatch
|
|
2059
2074
|
# of routing helpers, e.g:
|
2060
2075
|
#
|
2061
2076
|
# direct :homepage do
|
2062
|
-
# "
|
2077
|
+
# "https://rubyonrails.org"
|
2063
2078
|
# end
|
2064
2079
|
#
|
2065
2080
|
# direct :commentable do |model|
|
@@ -317,23 +317,21 @@ module ActionDispatch
|
|
317
317
|
#
|
318
318
|
def define_url_helper(mod, route, name, opts, route_key, url_strategy)
|
319
319
|
helper = UrlHelper.create(route, opts, route_key, url_strategy)
|
320
|
-
mod.
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
helper.call self, args, options
|
331
|
-
end
|
320
|
+
mod.define_method(name) do |*args|
|
321
|
+
last = args.last
|
322
|
+
options = \
|
323
|
+
case last
|
324
|
+
when Hash
|
325
|
+
args.pop
|
326
|
+
when ActionController::Parameters
|
327
|
+
args.pop.to_h
|
328
|
+
end
|
329
|
+
helper.call self, args, options
|
332
330
|
end
|
333
331
|
end
|
334
332
|
end
|
335
333
|
|
336
|
-
# strategy for building
|
334
|
+
# strategy for building URLs to send to the client
|
337
335
|
PATH = ->(options) { ActionDispatch::Http::URL.path_for(options) }
|
338
336
|
UNKNOWN = ->(options) { ActionDispatch::Http::URL.url_for(options) }
|
339
337
|
|
@@ -593,14 +591,14 @@ module ActionDispatch
|
|
593
591
|
if route.segment_keys.include?(:controller)
|
594
592
|
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
595
593
|
Using a dynamic :controller segment in a route is deprecated and
|
596
|
-
will be removed in Rails 6.
|
594
|
+
will be removed in Rails 6.1.
|
597
595
|
MSG
|
598
596
|
end
|
599
597
|
|
600
598
|
if route.segment_keys.include?(:action)
|
601
599
|
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
602
600
|
Using a dynamic :action segment in a route is deprecated and
|
603
|
-
will be removed in Rails 6.
|
601
|
+
will be removed in Rails 6.1.
|
604
602
|
MSG
|
605
603
|
end
|
606
604
|
|
@@ -4,13 +4,13 @@ gem "capybara", ">= 2.15"
|
|
4
4
|
|
5
5
|
require "capybara/dsl"
|
6
6
|
require "capybara/minitest"
|
7
|
+
require "selenium/webdriver"
|
7
8
|
require "action_controller"
|
8
9
|
require "action_dispatch/system_testing/driver"
|
9
10
|
require "action_dispatch/system_testing/browser"
|
10
11
|
require "action_dispatch/system_testing/server"
|
11
12
|
require "action_dispatch/system_testing/test_helpers/screenshot_helper"
|
12
13
|
require "action_dispatch/system_testing/test_helpers/setup_and_teardown"
|
13
|
-
require "action_dispatch/system_testing/test_helpers/undef_methods"
|
14
14
|
|
15
15
|
module ActionDispatch
|
16
16
|
# = System Testing
|
@@ -110,16 +110,27 @@ module ActionDispatch
|
|
110
110
|
# Because <tt>ActionDispatch::SystemTestCase</tt> is a shim between Capybara
|
111
111
|
# and Rails, any driver that is supported by Capybara is supported by system
|
112
112
|
# tests as long as you include the required gems and files.
|
113
|
-
class SystemTestCase <
|
113
|
+
class SystemTestCase < ActiveSupport::TestCase
|
114
114
|
include Capybara::DSL
|
115
115
|
include Capybara::Minitest::Assertions
|
116
116
|
include SystemTesting::TestHelpers::SetupAndTeardown
|
117
117
|
include SystemTesting::TestHelpers::ScreenshotHelper
|
118
|
-
include SystemTesting::TestHelpers::UndefMethods
|
119
118
|
|
120
119
|
def initialize(*) # :nodoc:
|
121
120
|
super
|
122
121
|
self.class.driver.use
|
122
|
+
@proxy_route = if ActionDispatch.test_app
|
123
|
+
Class.new do
|
124
|
+
include ActionDispatch.test_app.routes.url_helpers
|
125
|
+
include ActionDispatch.test_app.routes.mounted_helpers
|
126
|
+
|
127
|
+
def url_options
|
128
|
+
default_url_options.merge(host: Capybara.app_host)
|
129
|
+
end
|
130
|
+
end.new
|
131
|
+
else
|
132
|
+
nil
|
133
|
+
end
|
123
134
|
end
|
124
135
|
|
125
136
|
def self.start_application # :nodoc:
|
@@ -160,6 +171,14 @@ module ActionDispatch
|
|
160
171
|
|
161
172
|
driven_by :selenium
|
162
173
|
|
174
|
+
def method_missing(method, *args, &block)
|
175
|
+
if @proxy_route.respond_to?(method)
|
176
|
+
@proxy_route.send(method, *args, &block)
|
177
|
+
else
|
178
|
+
super
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
163
182
|
ActiveSupport.run_load_hooks(:action_dispatch_system_test_case, self)
|
164
183
|
end
|
165
184
|
|
@@ -39,6 +39,29 @@ module ActionDispatch
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
# driver_path can be configured as a proc. The webdrivers gem uses this
|
43
|
+
# proc to update web drivers. Running this proc early allows us to only
|
44
|
+
# update the webdriver once and avoid race conditions when using
|
45
|
+
# parallel tests.
|
46
|
+
def preload
|
47
|
+
case type
|
48
|
+
when :chrome
|
49
|
+
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
|
50
|
+
::Selenium::WebDriver::Chrome::Service.driver_path.try(:call)
|
51
|
+
else
|
52
|
+
# Selenium <= v3.141.0
|
53
|
+
::Selenium::WebDriver::Chrome.driver_path
|
54
|
+
end
|
55
|
+
when :firefox
|
56
|
+
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
|
57
|
+
::Selenium::WebDriver::Firefox::Service.driver_path.try(:call)
|
58
|
+
else
|
59
|
+
# Selenium <= v3.141.0
|
60
|
+
::Selenium::WebDriver::Firefox.driver_path
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
42
65
|
private
|
43
66
|
def headless_chrome_browser_options
|
44
67
|
capabilities.args << "--headless"
|
@@ -7,7 +7,6 @@ module ActionDispatch
|
|
7
7
|
DEFAULT_HOST = "http://127.0.0.1"
|
8
8
|
|
9
9
|
def host!(host)
|
10
|
-
super
|
11
10
|
Capybara.app_host = host
|
12
11
|
end
|
13
12
|
|
@@ -16,12 +15,14 @@ module ActionDispatch
|
|
16
15
|
super
|
17
16
|
end
|
18
17
|
|
18
|
+
def before_teardown
|
19
|
+
take_failed_screenshot
|
20
|
+
ensure
|
21
|
+
super
|
22
|
+
end
|
23
|
+
|
19
24
|
def after_teardown
|
20
|
-
|
21
|
-
take_failed_screenshot
|
22
|
-
ensure
|
23
|
-
Capybara.reset_sessions!
|
24
|
-
end
|
25
|
+
Capybara.reset_sessions!
|
25
26
|
ensure
|
26
27
|
super
|
27
28
|
end
|
@@ -14,7 +14,7 @@ module ActionDispatch
|
|
14
14
|
include Rails::Dom::Testing::Assertions
|
15
15
|
|
16
16
|
def html_document
|
17
|
-
@html_document ||= if @response.
|
17
|
+
@html_document ||= if @response.media_type.to_s.end_with?("xml")
|
18
18
|
Nokogiri::XML::Document.parse(@response.body)
|
19
19
|
else
|
20
20
|
Nokogiri::HTML::Document.parse(@response.body)
|