rails_kwargs_testing 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +27 -6
- data/Gemfile.lock +5 -5
- data/README.md +1 -0
- data/lib/rails_kwargs_testing/controller_methods.rb +13 -3
- data/lib/rails_kwargs_testing/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 14e73b9f27653333362304c0698f882b828e5600ab0a8993abf529af79a775b5
|
4
|
+
data.tar.gz: 8c996560bcfc85fa26c3944cb797c2faa8332e46503872d7f9d46d9f12996c8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72c578d89564f02c3ab6e62e1b106b7dbdbd5058cf22bb32cb0fb531d05ecf762fb195bb4310a3212b1311f61a39eca6d206f0ab774ee020d14017719c774235
|
7
|
+
data.tar.gz: e9f32c74a8af904c91fb7a423a25fa39bfbebaf01b345f0e5b27342b95105b9b047b053cf7d8b545d1bb977e20e551fbba37432c50f931e02115a48f87f1e529
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,32 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
7
|
|
7
|
-
|
8
|
+
## [0.2.0] - 2019-05-23
|
8
9
|
|
9
|
-
|
10
|
+
- Add `:as` option to controller methods.
|
10
11
|
|
11
|
-
-
|
12
|
+
## [0.1.2] - 2018-08-18
|
13
|
+
|
14
|
+
### Added
|
15
|
+
|
16
|
+
- Add `:xhr` option to controller methods.
|
17
|
+
|
18
|
+
## [0.1.1] - 2018-04-22
|
19
|
+
|
20
|
+
### Fixed
|
21
|
+
|
22
|
+
- Fix bug: remove non-existent `#head_via_redirect` method.
|
23
|
+
|
24
|
+
## 0.1.0 - 2018-04-21
|
25
|
+
|
26
|
+
### Added
|
27
|
+
|
28
|
+
- Released the 1st version.
|
29
|
+
|
30
|
+
[0.2.0]: https://github.com/r7kamura/rails_kwargs_testing/compare/v0.1.2...v0.2.0
|
31
|
+
[0.1.2]: https://github.com/r7kamura/rails_kwargs_testing/compare/v0.1.1...v0.1.2
|
32
|
+
[0.1.1]: https://github.com/r7kamura/rails_kwargs_testing/compare/v0.1.0...v0.1.1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_kwargs_testing (0.1.
|
4
|
+
rails_kwargs_testing (0.1.2)
|
5
5
|
rails (< 5)
|
6
6
|
|
7
7
|
GEM
|
@@ -55,12 +55,12 @@ GEM
|
|
55
55
|
nokogiri (>= 1.5.9)
|
56
56
|
mail (2.7.0)
|
57
57
|
mini_mime (>= 0.1.1)
|
58
|
-
mini_mime (1.0.
|
58
|
+
mini_mime (1.0.1)
|
59
59
|
mini_portile2 (2.3.0)
|
60
60
|
minitest (5.11.3)
|
61
|
-
nokogiri (1.8.
|
61
|
+
nokogiri (1.8.4)
|
62
62
|
mini_portile2 (~> 2.3.0)
|
63
|
-
rack (1.6.
|
63
|
+
rack (1.6.10)
|
64
64
|
rack-test (0.6.3)
|
65
65
|
rack (>= 1.0)
|
66
66
|
rails (4.2.10)
|
@@ -88,7 +88,7 @@ GEM
|
|
88
88
|
rake (>= 0.8.7)
|
89
89
|
thor (>= 0.18.1, < 2.0)
|
90
90
|
rake (10.5.0)
|
91
|
-
sprockets (3.7.
|
91
|
+
sprockets (3.7.2)
|
92
92
|
concurrent-ruby (~> 1.0)
|
93
93
|
rack (> 1, < 3)
|
94
94
|
sprockets-rails (3.2.1)
|
data/README.md
CHANGED
@@ -8,7 +8,11 @@ module RailsKwargsTesting
|
|
8
8
|
post
|
9
9
|
put
|
10
10
|
].each do |method_name|
|
11
|
-
define_method(method_name) do |action, flash: nil, format: nil, params: nil, session: nil, xhr: nil|
|
11
|
+
define_method(method_name) do |action, flash: nil, format: nil, params: nil, session: nil, xhr: nil, as: nil|
|
12
|
+
if as
|
13
|
+
format ||= as
|
14
|
+
end
|
15
|
+
|
12
16
|
if format
|
13
17
|
params = (params || {}).merge(format: format)
|
14
18
|
end
|
@@ -27,7 +31,7 @@ module RailsKwargsTesting
|
|
27
31
|
xhr
|
28
32
|
xml_http_request
|
29
33
|
].each do |method_name|
|
30
|
-
define_method(method_name) do |request_method, action, flash: nil, format: nil, params: nil, session: nil|
|
34
|
+
define_method(method_name) do |request_method, action, flash: nil, format: nil, params: nil, session: nil, as: nil|
|
31
35
|
insert_xhr_headers
|
32
36
|
__send__(request_method, action, flash: flash, format: format, params: params, session: session).tap do
|
33
37
|
reset_xhr_headers
|
@@ -39,7 +43,13 @@ module RailsKwargsTesting
|
|
39
43
|
|
40
44
|
def insert_xhr_headers
|
41
45
|
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'
|
42
|
-
@request.env['HTTP_ACCEPT'] ||=
|
46
|
+
@request.env['HTTP_ACCEPT'] ||= [
|
47
|
+
::Mime::JS,
|
48
|
+
::Mime::HTML,
|
49
|
+
::Mime::XML,
|
50
|
+
'text/xml',
|
51
|
+
::Mime::ALL,
|
52
|
+
].join(', ')
|
43
53
|
end
|
44
54
|
|
45
55
|
def reset_xhr_headers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_kwargs_testing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- r7kamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.6
|
111
|
+
rubygems_version: 2.7.6
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Provides Rails 5 compatible testing methods for gradual migration from Rails
|