actionpack 7.0.0.alpha2 → 7.0.0.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 +139 -0
- data/lib/abstract_controller/callbacks.rb +15 -2
- data/lib/abstract_controller/translation.rb +4 -1
- data/lib/action_controller/log_subscriber.rb +1 -2
- data/lib/action_controller/metal/helpers.rb +1 -1
- data/lib/action_controller/metal/http_authentication.rb +2 -1
- data/lib/action_controller/metal/instrumentation.rb +2 -0
- data/lib/action_controller/metal/params_wrapper.rb +13 -4
- data/lib/action_controller/metal/redirecting.rb +58 -22
- data/lib/action_controller/metal/request_forgery_protection.rb +30 -34
- data/lib/action_controller/metal/strong_parameters.rb +60 -19
- data/lib/action_controller/railtie.rb +16 -10
- data/lib/action_controller/test_case.rb +13 -2
- data/lib/action_controller.rb +0 -1
- data/lib/action_dispatch/http/response.rb +0 -12
- data/lib/action_dispatch/http/url.rb +2 -9
- data/lib/action_dispatch/journey/nodes/node.rb +2 -2
- data/lib/action_dispatch/journey/route.rb +1 -1
- data/lib/action_dispatch/middleware/cookies.rb +1 -1
- data/lib/action_dispatch/middleware/executor.rb +3 -0
- data/lib/action_dispatch/middleware/host_authorization.rb +41 -21
- data/lib/action_dispatch/middleware/server_timing.rb +33 -0
- data/lib/action_dispatch/middleware/show_exceptions.rb +10 -0
- data/lib/action_dispatch/middleware/static.rb +0 -1
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +1 -0
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +2 -0
- data/lib/action_dispatch/routing/inspector.rb +1 -1
- data/lib/action_dispatch/routing/mapper.rb +10 -6
- data/lib/action_dispatch/routing/route_set.rb +5 -0
- data/lib/action_dispatch/system_test_case.rb +7 -1
- data/lib/action_dispatch/system_testing/browser.rb +2 -12
- data/lib/action_dispatch/system_testing/driver.rb +13 -9
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +0 -8
- data/lib/action_dispatch/testing/test_process.rb +1 -27
- data/lib/action_dispatch.rb +1 -0
- data/lib/action_pack/gem_version.rb +1 -1
- metadata +14 -13
- data/lib/action_controller/metal/query_tags.rb +0 -16
@@ -3,13 +3,16 @@
|
|
3
3
|
module ActionDispatch
|
4
4
|
module SystemTesting
|
5
5
|
class Driver # :nodoc:
|
6
|
-
|
7
|
-
|
6
|
+
attr_reader :name
|
7
|
+
|
8
|
+
def initialize(driver_type, **options, &capabilities)
|
9
|
+
@driver_type = driver_type
|
8
10
|
@screen_size = options[:screen_size]
|
9
11
|
@options = options[:options] || {}
|
12
|
+
@name = @options.delete(:name) || driver_type
|
10
13
|
@capabilities = capabilities
|
11
14
|
|
12
|
-
if [:poltergeist, :webkit].include?(
|
15
|
+
if [:poltergeist, :webkit].include?(driver_type)
|
13
16
|
ActiveSupport::Deprecation.warn <<~MSG.squish
|
14
17
|
Poltergeist and capybara-webkit are not maintained already.
|
15
18
|
Driver registration of :poltergeist or :webkit is deprecated and will be removed in Rails 7.1.
|
@@ -17,7 +20,8 @@ module ActionDispatch
|
|
17
20
|
MSG
|
18
21
|
end
|
19
22
|
|
20
|
-
if
|
23
|
+
if driver_type == :selenium
|
24
|
+
gem "selenium-webdriver", ">= 4.0.0"
|
21
25
|
require "selenium/webdriver"
|
22
26
|
@browser = Browser.new(options[:using])
|
23
27
|
@browser.preload
|
@@ -34,14 +38,14 @@ module ActionDispatch
|
|
34
38
|
|
35
39
|
private
|
36
40
|
def registerable?
|
37
|
-
[:selenium, :poltergeist, :webkit, :cuprite, :rack_test].include?(@
|
41
|
+
[:selenium, :poltergeist, :webkit, :cuprite, :rack_test].include?(@driver_type)
|
38
42
|
end
|
39
43
|
|
40
44
|
def register
|
41
45
|
@browser&.configure(&@capabilities)
|
42
46
|
|
43
|
-
Capybara.register_driver
|
44
|
-
case @
|
47
|
+
Capybara.register_driver name do |app|
|
48
|
+
case @driver_type
|
45
49
|
when :selenium then register_selenium(app)
|
46
50
|
when :poltergeist then register_poltergeist(app)
|
47
51
|
when :webkit then register_webkit(app)
|
@@ -52,7 +56,7 @@ module ActionDispatch
|
|
52
56
|
end
|
53
57
|
|
54
58
|
def browser_options
|
55
|
-
@options.merge(
|
59
|
+
@options.merge(capabilities: @browser.options).compact
|
56
60
|
end
|
57
61
|
|
58
62
|
def register_selenium(app)
|
@@ -80,7 +84,7 @@ module ActionDispatch
|
|
80
84
|
end
|
81
85
|
|
82
86
|
def setup
|
83
|
-
Capybara.current_driver =
|
87
|
+
Capybara.current_driver = name
|
84
88
|
end
|
85
89
|
end
|
86
90
|
end
|
@@ -4,14 +4,6 @@ module ActionDispatch
|
|
4
4
|
module SystemTesting
|
5
5
|
module TestHelpers
|
6
6
|
module SetupAndTeardown # :nodoc:
|
7
|
-
def host!(host)
|
8
|
-
ActiveSupport::Deprecation.warn \
|
9
|
-
"ActionDispatch::SystemTestCase#host! is deprecated with no replacement. " \
|
10
|
-
"Set Capybara.app_host directly or rely on Capybara's default host."
|
11
|
-
|
12
|
-
Capybara.app_host = host
|
13
|
-
end
|
14
|
-
|
15
7
|
def before_teardown
|
16
8
|
take_failed_screenshot
|
17
9
|
ensure
|
@@ -17,33 +17,7 @@ module ActionDispatch
|
|
17
17
|
#
|
18
18
|
# post :change_avatar, params: { avatar: fixture_file_upload('david.png', 'image/png', :binary) }
|
19
19
|
def fixture_file_upload(path, mime_type = nil, binary = false)
|
20
|
-
if self.class.
|
21
|
-
!File.exist?(path)
|
22
|
-
original_path = path
|
23
|
-
path = Pathname.new(self.class.fixture_path).join(path)
|
24
|
-
|
25
|
-
if !self.class.file_fixture_path
|
26
|
-
ActiveSupport::Deprecation.warn(<<~EOM)
|
27
|
-
Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated.
|
28
|
-
In Rails 7.0, the path needs to be relative to `file_fixture_path` which you
|
29
|
-
haven't set yet. Set `file_fixture_path` to discard this warning.
|
30
|
-
EOM
|
31
|
-
elsif path.exist?
|
32
|
-
non_deprecated_path = Pathname(File.absolute_path(path)).relative_path_from(Pathname(File.absolute_path(self.class.file_fixture_path)))
|
33
|
-
|
34
|
-
if Pathname(original_path) != non_deprecated_path
|
35
|
-
ActiveSupport::Deprecation.warn(<<~EOM)
|
36
|
-
Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated.
|
37
|
-
In Rails 7.0, the path needs to be relative to `file_fixture_path`.
|
38
|
-
|
39
|
-
Please modify the call from
|
40
|
-
`fixture_file_upload("#{original_path}")` to `fixture_file_upload("#{non_deprecated_path}")`.
|
41
|
-
EOM
|
42
|
-
end
|
43
|
-
else
|
44
|
-
path = file_fixture(original_path)
|
45
|
-
end
|
46
|
-
elsif self.class.file_fixture_path && !File.exist?(path)
|
20
|
+
if self.class.file_fixture_path && !File.exist?(path)
|
47
21
|
path = file_fixture(path)
|
48
22
|
end
|
49
23
|
|
data/lib/action_dispatch.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.0.
|
4
|
+
version: 7.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.0.0.
|
19
|
+
version: 7.0.0.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.0.0.
|
26
|
+
version: 7.0.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,28 +98,28 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - '='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 7.0.0.
|
101
|
+
version: 7.0.0.rc1
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - '='
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: 7.0.0.
|
108
|
+
version: 7.0.0.rc1
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: activemodel
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
113
|
- - '='
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: 7.0.0.
|
115
|
+
version: 7.0.0.rc1
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - '='
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 7.0.0.
|
122
|
+
version: 7.0.0.rc1
|
123
123
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
124
124
|
testing MVC web applications. Works with any Rack-compatible server.
|
125
125
|
email: david@loudthinking.com
|
@@ -173,7 +173,6 @@ files:
|
|
173
173
|
- lib/action_controller/metal/parameter_encoding.rb
|
174
174
|
- lib/action_controller/metal/params_wrapper.rb
|
175
175
|
- lib/action_controller/metal/permissions_policy.rb
|
176
|
-
- lib/action_controller/metal/query_tags.rb
|
177
176
|
- lib/action_controller/metal/redirecting.rb
|
178
177
|
- lib/action_controller/metal/renderers.rb
|
179
178
|
- lib/action_controller/metal/rendering.rb
|
@@ -239,6 +238,7 @@ files:
|
|
239
238
|
- lib/action_dispatch/middleware/reloader.rb
|
240
239
|
- lib/action_dispatch/middleware/remote_ip.rb
|
241
240
|
- lib/action_dispatch/middleware/request_id.rb
|
241
|
+
- lib/action_dispatch/middleware/server_timing.rb
|
242
242
|
- lib/action_dispatch/middleware/session/abstract_store.rb
|
243
243
|
- lib/action_dispatch/middleware/session/cache_store.rb
|
244
244
|
- lib/action_dispatch/middleware/session/cookie_store.rb
|
@@ -310,10 +310,11 @@ licenses:
|
|
310
310
|
- MIT
|
311
311
|
metadata:
|
312
312
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
313
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.0.
|
314
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.0.
|
313
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.0.rc1/actionpack/CHANGELOG.md
|
314
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.0.rc1/
|
315
315
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
316
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.0.
|
316
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.0.rc1/actionpack
|
317
|
+
rubygems_mfa_required: 'true'
|
317
318
|
post_install_message:
|
318
319
|
rdoc_options: []
|
319
320
|
require_paths:
|
@@ -330,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
330
331
|
version: 1.3.1
|
331
332
|
requirements:
|
332
333
|
- none
|
333
|
-
rubygems_version: 3.
|
334
|
+
rubygems_version: 3.2.22
|
334
335
|
signing_key:
|
335
336
|
specification_version: 4
|
336
337
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionController
|
4
|
-
module QueryTags # :nodoc:
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
around_action :expose_controller_to_query_logs
|
9
|
-
end
|
10
|
-
|
11
|
-
private
|
12
|
-
def expose_controller_to_query_logs(&block)
|
13
|
-
ActiveRecord::QueryLogs.set_context(controller: self, &block)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|