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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 29d0bac64c9bc4345782c3debc41745fda7d8449
4
- data.tar.gz: efda1581cef21bdd007540051937bc13dacb6a0d
2
+ SHA256:
3
+ metadata.gz: 14e73b9f27653333362304c0698f882b828e5600ab0a8993abf529af79a775b5
4
+ data.tar.gz: 8c996560bcfc85fa26c3944cb797c2faa8332e46503872d7f9d46d9f12996c8d
5
5
  SHA512:
6
- metadata.gz: a05c2fa0c46fe0c35a679bc626a0cd85245a23b0f339e690e7e509f693fc20f71d9a8de6daf74029700b2e37024d38ed878e57458368770817464b5ed2f60e18
7
- data.tar.gz: 28be84356d263c943b6955c1a2e8f6ae8b3bcd28971acad2aa1934bc467f90a463b839f07c177d98b8759f521fb0e16aee86c5019a8ca3fa62111c1483f84c5d
6
+ metadata.gz: 72c578d89564f02c3ab6e62e1b106b7dbdbd5058cf22bb32cb0fb531d05ecf762fb195bb4310a3212b1311f61a39eca6d206f0ab774ee020d14017719c774235
7
+ data.tar.gz: e9f32c74a8af904c91fb7a423a25fa39bfbebaf01b345f0e5b27342b95105b9b047b053cf7d8b545d1bb977e20e551fbba37432c50f931e02115a48f87f1e529
@@ -1,11 +1,32 @@
1
- ## v0.1.2
1
+ # Changelog
2
2
 
3
- - Add `:xhr` option to controller methods
3
+ All notable changes to this project will be documented in this file.
4
4
 
5
- ## v0.1.1
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
- - Fix bug: remove non-existent `#head_via_redirect` method
8
+ ## [0.2.0] - 2019-05-23
8
9
 
9
- ## v0.1.0
10
+ - Add `:as` option to controller methods.
10
11
 
11
- - 1st release
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_kwargs_testing (0.1.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.0)
58
+ mini_mime (1.0.1)
59
59
  mini_portile2 (2.3.0)
60
60
  minitest (5.11.3)
61
- nokogiri (1.8.2)
61
+ nokogiri (1.8.4)
62
62
  mini_portile2 (~> 2.3.0)
63
- rack (1.6.9)
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.1)
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
@@ -34,6 +34,7 @@ Prepend RailsKwargsTesting::ControllerMethods. Supported options are:
34
34
  - :params
35
35
  - :session
36
36
  - :xhr
37
+ - :as
37
38
 
38
39
  ### Minitest
39
40
 
@@ -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'] ||= [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ')
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
@@ -1,3 +1,3 @@
1
1
  module RailsKwargsTesting
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.2
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: 2018-08-18 00:00:00.000000000 Z
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.11
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