rails-forward_compatible_controller_tests 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 790f7fe3a2d9e11bbf7ecbe22e5675e7c3bb00c1
4
- data.tar.gz: 252a93b427e536a95ed434d8e0508bcc356f9d51
3
+ metadata.gz: 3a7c8a5bbd6a9dda456e1c317403e547e10e90d8
4
+ data.tar.gz: d9554acb3f068a6a11bad0a78f6a950481994087
5
5
  SHA512:
6
- metadata.gz: d869af165f25668b7cab965247f7a663447e2ea80847f2734f1b429f1c26c1fa9eac33c7dda87ff8796bb314dafd800b4f100e83865c4e27c33ca3915f23a228
7
- data.tar.gz: 4e1e23cf89aae2969a451af71b566685e6f8f25fe781d04898860b9cbf0d1c5ad80b2de5cdee9e64cf414cf5c344c76732e202059865afead290df5c53834f25
6
+ metadata.gz: 00c8c8fc1ab3a6b31c7b8945ea324bdd10f9a0f9bad9483d57a677c267b8a11c3af4d75f01ee79f60800794cc1d9a5a30850c9e7e20aec91a1b50c06cb7c6b90
7
+ data.tar.gz: 281b5c207f6457e721d3404aa337007eefce34330568b77cb5ca53f6390588db51db0d251ebb6d070daedc1d41300901c5a14c9397b7a18c7fb4558d0bcac60e
@@ -50,11 +50,13 @@ module Rails
50
50
  request_session = args[1]&.dup if controller_test
51
51
  request_headers = args[1]&.dup unless controller_test
52
52
  request_flash = args[2]&.dup if controller_test
53
+ request_format = nil
53
54
 
54
55
  old_method = false
55
56
  xhr = false
56
57
  if request_params && request_params.is_a?(Hash)
57
58
  xhr = request_params.delete(:xhr)
59
+ request_format = request_params.delete(:format)
58
60
  if request_params[:params].is_a?(Hash)
59
61
  request_params.merge!(request_params.delete(:params) || {})
60
62
  request_session = request_params.delete(:session) || request_session if controller_test
@@ -80,7 +82,7 @@ module Rails
80
82
  request_session = nil
81
83
  request_headers = nil
82
84
  request_params = nil
83
- elsif !xhr
85
+ elsif !xhr && !request_format
84
86
  old_method = true
85
87
  end
86
88
  elsif request_headers.is_a?(Hash) || request_session.is_a?(Hash) ||
@@ -91,6 +93,8 @@ module Rails
91
93
  raise Exception, ERROR_MESSAGE if ForwardCompatibleControllerTests.raise_exception? && old_method
92
94
  ActiveSupport::Deprecation.warn(ERROR_MESSAGE) if ForwardCompatibleControllerTests.deprecated? && old_method
93
95
 
96
+ request_params[:format] = request_format if request_format
97
+
94
98
  if xhr
95
99
  ForwardCompatibleControllerTests.send(:with_ignore) do
96
100
  if controller_test
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module ForwardCompatibleControllerTests
3
- VERSION = "2.2.0"
3
+ VERSION = "2.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-forward_compatible_controller_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-03 00:00:00.000000000 Z
11
+ date: 2018-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler