my_api_client 0.16.0 → 0.16.1

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
  SHA256:
3
- metadata.gz: 81476ec85e1664e0b1109e44ea2c5b29eaf110954e687712826886d5e986b06f
4
- data.tar.gz: 226c07c69e767db0863449d66585b2c1c42ececb529a727147e14e5fe70049db
3
+ metadata.gz: 1eb52f8cf1220f7a0db30d5a6f83a8ef880315d6f23f878103ea234812c4071e
4
+ data.tar.gz: d6176d4ea51df4d2486be4150055b05b60ded0d674c937c61bc46dc9df79f0a6
5
5
  SHA512:
6
- metadata.gz: '009f14b37302243f4063703f8d5dd41680e6821b013e935165e9110c680b5b98cca9317d5e3abac8fade76f6fb0ba07aac0edad3bfb2b441e4a86f7e95e14534'
7
- data.tar.gz: b718464bb2245c646692f2b0e5ce2dcbac6e7f15f2d4b88b7c5393c097116ed627f59371f9a75a51fdbebedf773c3de73780a92334214b725ebe3373ba72d6f1
6
+ metadata.gz: 4bfcd9f62258c714797b9234959f53b2c84c2bc7c651d8ea6b4ba8ce2a6750c8528c8cd33ee842f090c01414c65028d0e8c412a2ec3e425b9382984f632cda37
7
+ data.tar.gz: 6f48b2d64393db7ca69da8e68236c095f5bf94fd424e87cd805cb264a09e616782816d7b83308b512d6e45a3f500b6c85f1a2f93e2ef6b96cb2a23d486909561
@@ -165,6 +165,16 @@ commands:
165
165
  - rake_build
166
166
 
167
167
  jobs:
168
+ test_api:
169
+ parameters:
170
+ <<: *ruby_version
171
+ executor:
172
+ name: executor_for_api
173
+ ruby_version: << parameters.ruby_version >>
174
+ steps:
175
+ - setup:
176
+ ruby_version: << parameters.ruby_version >>
177
+ - run_rspec_for_api
168
178
  deploy_api:
169
179
  parameters:
170
180
  <<: *ruby_version
@@ -303,6 +313,7 @@ workflows:
303
313
  ruby_version: '2.7'
304
314
  rails_version: '6.0'
305
315
  bundler_options: '--without integrations'
316
+ - test_api
306
317
  - rubocop
307
318
  - yardoc
308
319
  - upload-coverage:
@@ -0,0 +1,3 @@
1
+ ---
2
+ Ignore:
3
+ - Performance/StartWith
@@ -1,7 +1,12 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-02-29 23:30:46 +0000 using RuboCop version 0.80.1.
3
+ # on 2020-08-17 23:30:51 UTC using RuboCop version 0.89.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 60
10
+ # Configuration parameters: AllowSubject.
11
+ RSpec/MultipleMemoizedHelpers:
12
+ Max: 15
@@ -1,5 +1,39 @@
1
1
  # Change log
2
2
 
3
+ ## v0.16.1 (Aug 27, 2020)
4
+
5
+ ### Feature
6
+
7
+ * [#296](https://github.com/ryz310/my_api_client/pull/296) Support HTTP PUT method ([@ryz310](https://github.com/ryz310))
8
+
9
+ ### Rubocop Challenge
10
+
11
+ * [#256](https://github.com/ryz310/my_api_client/pull/256) Performance/StartWith-20200523233027 ([@ryz310](https://github.com/ryz310))
12
+ * [#268](https://github.com/ryz310/my_api_client/pull/268) Lint/RedundantCopDisableDirective-20200622233019 ([@ryz310](https://github.com/ryz310))
13
+ * [#289](https://github.com/ryz310/my_api_client/pull/289) Re-generate .rubocop_todo.yml with RuboCop v0.89.1 ([@ryz310](https://github.com/ryz310))
14
+ * [#293](https://github.com/ryz310/my_api_client/pull/293) RSpec/LeadingSubject-20200817233022 ([@ryz310](https://github.com/ryz310))
15
+
16
+ ### Dependabot
17
+
18
+ * [#232](https://github.com/ryz310/my_api_client/pull/232) ryz310/dependabot/bundler/faraday-1.0.1 ([@ryz310](https://github.com/ryz310))
19
+ * [#241](https://github.com/ryz310/my_api_client/pull/241) ryz310/dependabot/bundler/my_api/byebug-11.1.3 ([@ryz310](https://github.com/ryz310))
20
+ * [#243](https://github.com/ryz310/my_api_client/pull/243) ryz310/dependabot/bundler/yard-0.9.25 ([@ryz310](https://github.com/ryz310))
21
+ * [#248](https://github.com/ryz310/my_api_client/pull/248) ryz310/dependabot/bundler/activesupport-5.2.4.3 ([@ryz310](https://github.com/ryz310))
22
+ * [#251](https://github.com/ryz310/my_api_client/pull/251) ryz310/dependabot/bundler/my_api/puma-4.3.5 ([@ryz310](https://github.com/ryz310))
23
+ * [#257](https://github.com/ryz310/my_api_client/pull/257) ryz310/dependabot/bundler/my_api/dynomite-1.2.6 ([@ryz310](https://github.com/ryz310))
24
+ * [#264](https://github.com/ryz310/my_api_client/pull/264) ryz310/dependabot/bundler/my_api/rack-2.2.3 ([@ryz310](https://github.com/ryz310))
25
+ * [#265](https://github.com/ryz310/my_api_client/pull/265) ryz310/dependabot/bundler/my_api/actionpack-6.0.3.2 ([@ryz310](https://github.com/ryz310))
26
+ * [#266](https://github.com/ryz310/my_api_client/pull/266) ryz310/dependabot/bundler/my_api/capybara-3.33.0 ([@ryz310](https://github.com/ryz310))
27
+ * [#281](https://github.com/ryz310/my_api_client/pull/281) ryz310/dependabot/bundler/rubocop-performance-1.7.1 ([@ryz310](https://github.com/ryz310))
28
+ * [#287](https://github.com/ryz310/my_api_client/pull/287) ryz310/dependabot/bundler/my_api/kramdown-2.3.0 ([@ryz310](https://github.com/ryz310))
29
+ * [#290](https://github.com/ryz310/my_api_client/pull/290) ryz310/dependabot/bundler/bugsnag-6.16.0 ([@ryz310](https://github.com/ryz310))
30
+ * [#294](https://github.com/ryz310/my_api_client/pull/294) ryz310/dependabot/bundler/my_api/jets-2.3.17 ([@ryz310](https://github.com/ryz310))
31
+ * [#295](https://github.com/ryz310/my_api_client/pull/295) ryz310/dependabot/bundler/rubocop-rspec-1.43.2 ([@ryz310](https://github.com/ryz310))
32
+
33
+ ### Misc
34
+
35
+ * [#271](https://github.com/ryz310/my_api_client/pull/271) Minor fixes ([@ryz310](https://github.com/ryz310))
36
+
3
37
  ## v0.16.0 (Mar 29, 2020)
4
38
 
5
39
  ### Breaking Change
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- my_api_client (0.16.0)
4
+ my_api_client (0.16.1)
5
5
  activesupport (>= 4.2.0)
6
6
  faraday (>= 0.17.1)
7
7
  jsonpath
@@ -10,77 +10,80 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (5.2.4.2)
13
+ activesupport (5.2.4.3)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 0.7, < 2)
16
16
  minitest (~> 5.1)
17
17
  tzinfo (~> 1.1)
18
18
  addressable (2.7.0)
19
19
  public_suffix (>= 2.0.2, < 5.0)
20
- ast (2.4.0)
21
- bugsnag (6.13.0)
20
+ ast (2.4.1)
21
+ bugsnag (6.16.0)
22
22
  concurrent-ruby (~> 1.0)
23
- byebug (11.1.1)
24
- coderay (1.1.2)
25
- concurrent-ruby (1.1.6)
23
+ byebug (11.1.3)
24
+ coderay (1.1.3)
25
+ concurrent-ruby (1.1.7)
26
26
  crack (0.4.3)
27
27
  safe_yaml (~> 1.0.0)
28
- diff-lcs (1.3)
28
+ diff-lcs (1.4.4)
29
29
  docile (1.3.2)
30
- faraday (1.0.0)
30
+ faraday (1.0.1)
31
31
  multipart-post (>= 1.2, < 3)
32
32
  hashdiff (1.0.1)
33
- i18n (1.8.2)
33
+ i18n (1.8.5)
34
34
  concurrent-ruby (~> 1.0)
35
- jaro_winkler (1.5.4)
36
- json (2.3.0)
35
+ json (2.3.1)
37
36
  jsonpath (1.0.5)
38
37
  multi_json
39
38
  to_regexp (~> 0.2.1)
40
39
  method_source (1.0.0)
41
- minitest (5.14.0)
42
- multi_json (1.14.1)
40
+ minitest (5.14.1)
41
+ multi_json (1.15.0)
43
42
  multipart-post (2.1.1)
44
- parallel (1.19.1)
45
- parser (2.7.0.5)
46
- ast (~> 2.4.0)
47
- pry (0.13.0)
43
+ parallel (1.19.2)
44
+ parser (2.7.1.4)
45
+ ast (~> 2.4.1)
46
+ pry (0.13.1)
48
47
  coderay (~> 1.1)
49
48
  method_source (~> 1.0)
50
49
  pry-byebug (3.9.0)
51
50
  byebug (~> 11.0)
52
51
  pry (~> 0.13.0)
53
- public_suffix (4.0.3)
52
+ public_suffix (4.0.5)
54
53
  rainbow (3.0.0)
55
54
  rake (13.0.1)
55
+ regexp_parser (1.7.1)
56
56
  rexml (3.2.4)
57
57
  rspec (3.9.0)
58
58
  rspec-core (~> 3.9.0)
59
59
  rspec-expectations (~> 3.9.0)
60
60
  rspec-mocks (~> 3.9.0)
61
- rspec-core (3.9.1)
62
- rspec-support (~> 3.9.1)
63
- rspec-expectations (3.9.1)
61
+ rspec-core (3.9.2)
62
+ rspec-support (~> 3.9.3)
63
+ rspec-expectations (3.9.2)
64
64
  diff-lcs (>= 1.2.0, < 2.0)
65
65
  rspec-support (~> 3.9.0)
66
66
  rspec-mocks (3.9.1)
67
67
  diff-lcs (>= 1.2.0, < 2.0)
68
68
  rspec-support (~> 3.9.0)
69
- rspec-support (3.9.2)
69
+ rspec-support (3.9.3)
70
70
  rspec_junit_formatter (0.4.1)
71
71
  rspec-core (>= 2, < 4, != 2.12.0)
72
- rubocop (0.80.1)
73
- jaro_winkler (~> 1.5.1)
72
+ rubocop (0.89.1)
74
73
  parallel (~> 1.10)
75
- parser (>= 2.7.0.1)
74
+ parser (>= 2.7.1.1)
76
75
  rainbow (>= 2.2.2, < 4.0)
76
+ regexp_parser (>= 1.7)
77
77
  rexml
78
+ rubocop-ast (>= 0.3.0, < 1.0)
78
79
  ruby-progressbar (~> 1.7)
79
- unicode-display_width (>= 1.4.0, < 1.7)
80
- rubocop-performance (1.5.2)
81
- rubocop (>= 0.71.0)
82
- rubocop-rspec (1.38.1)
83
- rubocop (>= 0.68.1)
80
+ unicode-display_width (>= 1.4.0, < 2.0)
81
+ rubocop-ast (0.3.0)
82
+ parser (>= 2.7.1.4)
83
+ rubocop-performance (1.7.1)
84
+ rubocop (>= 0.82.0)
85
+ rubocop-rspec (1.43.2)
86
+ rubocop (~> 0.87)
84
87
  ruby-progressbar (1.10.1)
85
88
  safe_yaml (1.0.5)
86
89
  sawyer (0.8.2)
@@ -93,14 +96,14 @@ GEM
93
96
  simplecov-html (0.10.2)
94
97
  thread_safe (0.3.6)
95
98
  to_regexp (0.2.1)
96
- tzinfo (1.2.6)
99
+ tzinfo (1.2.7)
97
100
  thread_safe (~> 0.1)
98
- unicode-display_width (1.6.1)
101
+ unicode-display_width (1.7.0)
99
102
  webmock (3.8.3)
100
103
  addressable (>= 2.3.6)
101
104
  crack (>= 0.3.2)
102
105
  hashdiff (>= 0.4.0, < 2.0.0)
103
- yard (0.9.24)
106
+ yard (0.9.25)
104
107
 
105
108
  PLATFORMS
106
109
  ruby
@@ -122,4 +125,4 @@ DEPENDENCIES
122
125
  yard
123
126
 
124
127
  BUNDLED WITH
125
- 2.1.2
128
+ 2.1.4
@@ -3,6 +3,10 @@
3
3
 
4
4
  require 'bundler/setup'
5
5
  require 'my_api_client'
6
+ require './example/api_clients/my_error_api_client'
7
+ require './example/api_clients/my_rest_api_client'
8
+ require './example/api_clients/my_pagination_api_client'
9
+ require './example/api_clients/my_status_api_client'
6
10
 
7
11
  # You can add fixtures and/or initialization code here to make experimenting
8
12
  # with your gem easier. You can also use a different console, if you like.
@@ -8,6 +8,6 @@ class ApplicationApiClient < MyApiClient::Base
8
8
 
9
9
  self.logger = ::Logger.new(nil)
10
10
 
11
- http_open_timeout 2.seconds
12
- http_read_timeout 3.seconds
11
+ http_open_timeout 5.seconds
12
+ http_read_timeout 5.seconds
13
13
  end
@@ -18,13 +18,19 @@ class MyRestApiClient < ApplicationApiClient
18
18
  end
19
19
 
20
20
  # POST rest
21
- def create_post(title:)
21
+ def post_post(title:)
22
22
  body = { title: title }
23
23
  post 'rest', body: body, headers: headers
24
24
  end
25
25
 
26
- # POST/PUT/PATCH rest/:id
27
- def update_post(id:, title:)
26
+ # PUT rest/:id
27
+ def put_post(id:, title:)
28
+ body = { title: title }
29
+ put "rest/#{id}", body: body, headers: headers
30
+ end
31
+
32
+ # PATCH rest/:id
33
+ def patch_post(id:, title:)
28
34
  body = { title: title }
29
35
  patch "rest/#{id}", body: body, headers: headers
30
36
  end
@@ -85,7 +85,6 @@ module MyApiClient
85
85
  end
86
86
  end
87
87
 
88
- # rubocop:disable Metrics/CyclomaticComplexity
89
88
  def match?(operator, target)
90
89
  case operator
91
90
  when nil
@@ -102,7 +101,6 @@ module MyApiClient
102
101
  raise "Unexpected operator type was given: #{operator.inspect}"
103
102
  end
104
103
  end
105
- # rubocop:enable Metrics/CyclomaticComplexity
106
104
 
107
105
  def match_all?(json, response_body)
108
106
  return true if json.nil?
@@ -11,7 +11,7 @@ module MyApiClient
11
11
  # Executes HTTP request with relative URI.
12
12
  #
13
13
  # @param http_method [Symbol]
14
- # HTTP method. e.g. `:get`, `:post`, `:patch` and `:delete`.
14
+ # HTTP method. e.g. `:get`, `:post`, `:put`, `:patch` and `:delete`.
15
15
  # @param pathname [String]
16
16
  # Pathname of the request target URL.
17
17
  # It's joined with the defined by `endpoint`.
@@ -32,7 +32,7 @@ module MyApiClient
32
32
  # Executes HTTP request with absolute URI.
33
33
  #
34
34
  # @param http_method [Symbol]
35
- # HTTP method. e.g. `:get`, `:post`, `:patch` and `:delete`.
35
+ # HTTP method. e.g. `:get`, `:post`, `:put`, `:patch` and `:delete`.
36
36
  # @param uri [URI]
37
37
  # Request target URI including query strings.
38
38
  # @param headers [Hash, nil]
@@ -4,7 +4,7 @@ module MyApiClient
4
4
  module Request
5
5
  # Provides basic HTTP request method.
6
6
  module Basic
7
- HTTP_METHODS = %i[get post patch delete].freeze
7
+ HTTP_METHODS = %i[get post put patch delete].freeze
8
8
 
9
9
  HTTP_METHODS.each do |http_method|
10
10
  class_eval <<~METHOD, __FILE__, __LINE__ + 1
@@ -27,8 +27,6 @@ module MyApiClient
27
27
  end
28
28
  METHOD
29
29
  end
30
-
31
- alias put patch
32
30
  end
33
31
  end
34
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MyApiClient
4
- VERSION = '0.16.0'
4
+ VERSION = '0.16.1'
5
5
  end
@@ -1,43 +1,43 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- actionmailer (6.0.2.2)
5
- actionpack (= 6.0.2.2)
6
- actionview (= 6.0.2.2)
7
- activejob (= 6.0.2.2)
4
+ actionmailer (6.0.3.2)
5
+ actionpack (= 6.0.3.2)
6
+ actionview (= 6.0.3.2)
7
+ activejob (= 6.0.3.2)
8
8
  mail (~> 2.5, >= 2.5.4)
9
9
  rails-dom-testing (~> 2.0)
10
- actionpack (6.0.2.2)
11
- actionview (= 6.0.2.2)
12
- activesupport (= 6.0.2.2)
10
+ actionpack (6.0.3.2)
11
+ actionview (= 6.0.3.2)
12
+ activesupport (= 6.0.3.2)
13
13
  rack (~> 2.0, >= 2.0.8)
14
14
  rack-test (>= 0.6.3)
15
15
  rails-dom-testing (~> 2.0)
16
16
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
- actionview (6.0.2.2)
18
- activesupport (= 6.0.2.2)
17
+ actionview (6.0.3.2)
18
+ activesupport (= 6.0.3.2)
19
19
  builder (~> 3.1)
20
20
  erubi (~> 1.4)
21
21
  rails-dom-testing (~> 2.0)
22
22
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
- activejob (6.0.2.2)
24
- activesupport (= 6.0.2.2)
23
+ activejob (6.0.3.2)
24
+ activesupport (= 6.0.3.2)
25
25
  globalid (>= 0.3.6)
26
- activemodel (6.0.2.2)
27
- activesupport (= 6.0.2.2)
28
- activerecord (6.0.2.2)
29
- activemodel (= 6.0.2.2)
30
- activesupport (= 6.0.2.2)
31
- activesupport (6.0.2.2)
26
+ activemodel (6.0.3.2)
27
+ activesupport (= 6.0.3.2)
28
+ activerecord (6.0.3.2)
29
+ activemodel (= 6.0.3.2)
30
+ activesupport (= 6.0.3.2)
31
+ activesupport (6.0.3.2)
32
32
  concurrent-ruby (~> 1.0, >= 1.0.2)
33
33
  i18n (>= 0.7, < 2)
34
34
  minitest (~> 5.1)
35
35
  tzinfo (~> 1.1)
36
- zeitwerk (~> 2.2)
36
+ zeitwerk (~> 2.2, >= 2.2.2)
37
37
  addressable (2.7.0)
38
38
  public_suffix (>= 2.0.2, < 5.0)
39
- aws-eventstream (1.0.3)
40
- aws-mfa-secure (0.4.0)
39
+ aws-eventstream (1.1.0)
40
+ aws-mfa-secure (0.4.2)
41
41
  activesupport
42
42
  aws-sdk-core
43
43
  aws_config
@@ -45,52 +45,52 @@ GEM
45
45
  rainbow
46
46
  thor
47
47
  zeitwerk
48
- aws-partitions (1.290.0)
49
- aws-sdk-apigateway (1.37.0)
50
- aws-sdk-core (~> 3, >= 3.71.0)
48
+ aws-partitions (1.358.0)
49
+ aws-sdk-apigateway (1.49.0)
50
+ aws-sdk-core (~> 3, >= 3.99.0)
51
51
  aws-sigv4 (~> 1.1)
52
- aws-sdk-cloudformation (1.31.0)
53
- aws-sdk-core (~> 3, >= 3.71.0)
52
+ aws-sdk-cloudformation (1.41.0)
53
+ aws-sdk-core (~> 3, >= 3.99.0)
54
54
  aws-sigv4 (~> 1.1)
55
- aws-sdk-cloudwatchlogs (1.29.0)
56
- aws-sdk-core (~> 3, >= 3.71.0)
55
+ aws-sdk-cloudwatchlogs (1.34.0)
56
+ aws-sdk-core (~> 3, >= 3.99.0)
57
57
  aws-sigv4 (~> 1.1)
58
- aws-sdk-core (3.92.0)
59
- aws-eventstream (~> 1.0, >= 1.0.2)
58
+ aws-sdk-core (3.104.4)
59
+ aws-eventstream (~> 1, >= 1.0.2)
60
60
  aws-partitions (~> 1, >= 1.239.0)
61
61
  aws-sigv4 (~> 1.1)
62
62
  jmespath (~> 1.0)
63
- aws-sdk-dynamodb (1.45.0)
64
- aws-sdk-core (~> 3, >= 3.71.0)
63
+ aws-sdk-dynamodb (1.51.0)
64
+ aws-sdk-core (~> 3, >= 3.99.0)
65
65
  aws-sigv4 (~> 1.1)
66
- aws-sdk-kinesis (1.21.0)
67
- aws-sdk-core (~> 3, >= 3.71.0)
66
+ aws-sdk-kinesis (1.27.0)
67
+ aws-sdk-core (~> 3, >= 3.99.0)
68
68
  aws-sigv4 (~> 1.1)
69
- aws-sdk-kms (1.30.0)
70
- aws-sdk-core (~> 3, >= 3.71.0)
69
+ aws-sdk-kms (1.36.0)
70
+ aws-sdk-core (~> 3, >= 3.99.0)
71
71
  aws-sigv4 (~> 1.1)
72
- aws-sdk-lambda (1.37.0)
73
- aws-sdk-core (~> 3, >= 3.71.0)
72
+ aws-sdk-lambda (1.48.0)
73
+ aws-sdk-core (~> 3, >= 3.99.0)
74
74
  aws-sigv4 (~> 1.1)
75
- aws-sdk-s3 (1.61.1)
76
- aws-sdk-core (~> 3, >= 3.83.0)
75
+ aws-sdk-s3 (1.78.0)
76
+ aws-sdk-core (~> 3, >= 3.104.3)
77
77
  aws-sdk-kms (~> 1)
78
78
  aws-sigv4 (~> 1.1)
79
- aws-sdk-sns (1.22.0)
80
- aws-sdk-core (~> 3, >= 3.71.0)
79
+ aws-sdk-sns (1.29.0)
80
+ aws-sdk-core (~> 3, >= 3.99.0)
81
81
  aws-sigv4 (~> 1.1)
82
- aws-sdk-sqs (1.24.0)
83
- aws-sdk-core (~> 3, >= 3.71.0)
82
+ aws-sdk-sqs (1.30.0)
83
+ aws-sdk-core (~> 3, >= 3.99.0)
84
84
  aws-sigv4 (~> 1.1)
85
- aws-sdk-ssm (1.73.0)
86
- aws-sdk-core (~> 3, >= 3.71.0)
85
+ aws-sdk-ssm (1.86.0)
86
+ aws-sdk-core (~> 3, >= 3.99.0)
87
87
  aws-sigv4 (~> 1.1)
88
- aws-sigv4 (1.1.1)
89
- aws-eventstream (~> 1.0, >= 1.0.2)
88
+ aws-sigv4 (1.2.2)
89
+ aws-eventstream (~> 1, >= 1.0.2)
90
90
  aws_config (0.1.0)
91
91
  builder (3.2.4)
92
- byebug (11.1.1)
93
- capybara (3.31.0)
92
+ byebug (11.1.3)
93
+ capybara (3.33.0)
94
94
  addressable
95
95
  mini_mime (>= 0.1.3)
96
96
  nokogiri (~> 1.8)
@@ -103,11 +103,11 @@ GEM
103
103
  memoist
104
104
  rainbow
105
105
  cfnresponse (0.4.0)
106
- concurrent-ruby (1.1.6)
106
+ concurrent-ruby (1.1.7)
107
107
  crass (1.0.6)
108
108
  diff-lcs (1.3)
109
- dotenv (2.7.5)
110
- dynomite (1.2.5)
109
+ dotenv (2.7.6)
110
+ dynomite (1.2.6)
111
111
  activesupport
112
112
  aws-sdk-dynamodb
113
113
  rainbow
@@ -116,9 +116,9 @@ GEM
116
116
  globalid (0.4.2)
117
117
  activesupport (>= 4.2.0)
118
118
  hashie (4.1.0)
119
- i18n (1.8.2)
119
+ i18n (1.8.5)
120
120
  concurrent-ruby (~> 1.0)
121
- jets (2.3.15)
121
+ jets (2.3.17)
122
122
  actionmailer (~> 6.0.0)
123
123
  actionpack (~> 6.0.0)
124
124
  actionview (~> 6.0.0)
@@ -142,7 +142,6 @@ GEM
142
142
  hashie
143
143
  jets-gems
144
144
  jets-html-sanitizer
145
- json
146
145
  kramdown
147
146
  memoist
148
147
  mimemagic
@@ -159,28 +158,28 @@ GEM
159
158
  jets-html-sanitizer (1.0.4)
160
159
  loofah (~> 2.2, >= 2.2.2)
161
160
  jmespath (1.4.0)
162
- json (2.3.0)
163
- kramdown (2.1.0)
161
+ kramdown (2.3.0)
162
+ rexml
164
163
  launchy (2.5.0)
165
164
  addressable (~> 2.7)
166
- loofah (2.4.0)
165
+ loofah (2.6.0)
167
166
  crass (~> 1.0.2)
168
167
  nokogiri (>= 1.5.9)
169
168
  mail (2.7.1)
170
169
  mini_mime (>= 0.1.1)
171
170
  memoist (0.16.2)
172
171
  method_source (1.0.0)
173
- mimemagic (0.3.4)
172
+ mimemagic (0.3.5)
174
173
  mini_mime (1.0.2)
175
174
  mini_portile2 (2.4.0)
176
- minitest (5.14.0)
175
+ minitest (5.14.1)
177
176
  nio4r (2.5.2)
178
- nokogiri (1.10.9)
177
+ nokogiri (1.10.10)
179
178
  mini_portile2 (~> 2.4.0)
180
- public_suffix (4.0.3)
181
- puma (4.3.3)
179
+ public_suffix (4.0.5)
180
+ puma (4.3.5)
182
181
  nio4r (~> 2.0)
183
- rack (2.2.2)
182
+ rack (2.2.3)
184
183
  rack-test (1.1.0)
185
184
  rack (>= 1.0, < 3)
186
185
  rails-dom-testing (2.0.3)
@@ -188,16 +187,17 @@ GEM
188
187
  nokogiri (>= 1.6)
189
188
  rails-html-sanitizer (1.3.0)
190
189
  loofah (~> 2.3)
191
- railties (6.0.2.2)
192
- actionpack (= 6.0.2.2)
193
- activesupport (= 6.0.2.2)
190
+ railties (6.0.3.2)
191
+ actionpack (= 6.0.3.2)
192
+ activesupport (= 6.0.3.2)
194
193
  method_source
195
194
  rake (>= 0.8.7)
196
195
  thor (>= 0.20.3, < 2.0)
197
196
  rainbow (3.0.0)
198
197
  rake (13.0.1)
199
- recursive-open-struct (1.1.1)
200
- regexp_parser (1.7.0)
198
+ recursive-open-struct (1.1.2)
199
+ regexp_parser (1.7.1)
200
+ rexml (3.2.4)
201
201
  rspec (3.9.0)
202
202
  rspec-core (~> 3.9.0)
203
203
  rspec-expectations (~> 3.9.0)
@@ -218,11 +218,11 @@ GEM
218
218
  text-table (1.2.4)
219
219
  thor (1.0.1)
220
220
  thread_safe (0.3.6)
221
- tzinfo (1.2.6)
221
+ tzinfo (1.2.7)
222
222
  thread_safe (~> 0.1)
223
223
  xpath (3.2.0)
224
224
  nokogiri (~> 1.8)
225
- zeitwerk (2.3.0)
225
+ zeitwerk (2.4.0)
226
226
 
227
227
  PLATFORMS
228
228
  ruby
@@ -60,14 +60,32 @@ describe RestController, type: :controller do
60
60
  end
61
61
 
62
62
  describe '#update' do
63
- let(:post) do
63
+ let(:the_post) do
64
64
  { id: 1, title: 'Modified title' }.to_json
65
65
  end
66
66
 
67
- it 'returns a updated post' do
68
- patch '/rest/:id', id: 1, title: 'Modified title'
69
- expect(response.status).to eq 200
70
- expect(response.body).to eq post
67
+ context 'with POST method' do
68
+ it 'returns a updated post' do
69
+ post '/rest/:id', id: 1, title: 'Modified title'
70
+ expect(response.status).to eq 200
71
+ expect(response.body).to eq the_post
72
+ end
73
+ end
74
+
75
+ context 'with PUT method' do
76
+ it 'returns a updated post' do
77
+ put '/rest/:id', id: 1, title: 'Modified title'
78
+ expect(response.status).to eq 200
79
+ expect(response.body).to eq the_post
80
+ end
81
+ end
82
+
83
+ context 'with PATCH method' do
84
+ it 'returns a updated post' do
85
+ patch '/rest/:id', id: 1, title: 'Modified title'
86
+ expect(response.status).to eq 200
87
+ expect(response.body).to eq the_post
88
+ end
71
89
  end
72
90
  end
73
91
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryz310
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-29 00:00:00.000000000 Z
11
+ date: 2020-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -234,6 +234,7 @@ files:
234
234
  - ".gitignore"
235
235
  - ".rspec"
236
236
  - ".rubocop.yml"
237
+ - ".rubocop_challenge.yml"
237
238
  - ".rubocop_todo.yml"
238
239
  - CHANGELOG.md
239
240
  - CODE_OF_CONDUCT.md