rakuten_web_service 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/rakuten_web_service/recipe.rb +4 -2
- data/lib/rakuten_web_service/version.rb +1 -1
- data/spec/rakuten_web_service/recipe_spec.rb +42 -13
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5971dec1936ae9d551e73800107c2d1a99fed04
|
4
|
+
data.tar.gz: 9437dd7d638465c013db48a760f703d31e333ad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c66a18c2a9fed5a35caf4ef91a70a5665498a18b75e7ec9d1fb31fb1d196898b3fc48924025013b6ef27ca429f742cf882ea5d357c4c9531ac08c45bb31455f2
|
7
|
+
data.tar.gz: 1cb65253cdb7b1317a3b04a0683ca5a60d5150f02d90602205107cfbbdcddd747118fabfade92ef58840085c65d1644f88df91ab4fc59cb0e7b16b31c2d0fcd3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
# v1.5.0 (2017/03/31)
|
2
|
+
|
3
|
+
## Improvements
|
4
|
+
|
5
|
+
* Allows to call `RakutenWebService::Recipe.ranking` without `category_id`. [#70](https://github.com/rakuten-ws/rws-ruby-sdk/pull/70)
|
6
|
+
|
7
|
+
## Thanks
|
8
|
+
|
9
|
+
I'm pleasured to say thanks to @kakakakakku. His work has made the usage of `RWS::Recipe.raning` easy to get the ranking in all genres.
|
10
|
+
Thanks!
|
11
|
+
|
1
12
|
# v1.4.2 (2017/01/22)
|
2
13
|
|
3
14
|
## Bug Fixes
|
@@ -17,8 +17,10 @@ module RakutenWebService
|
|
17
17
|
response['result'].map { |r| Recipe.new(r) }
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.ranking(
|
21
|
-
|
20
|
+
def self.ranking(category_id = nil)
|
21
|
+
params = {}
|
22
|
+
params.merge!(category_id: category_id) unless category_id.nil?
|
23
|
+
self.search(params)
|
22
24
|
end
|
23
25
|
|
24
26
|
class << self
|
@@ -11,6 +11,12 @@ describe RakutenWebService::Recipe do
|
|
11
11
|
categoryId: category_id
|
12
12
|
}
|
13
13
|
end
|
14
|
+
let(:expected_query_without_category_id) do
|
15
|
+
{
|
16
|
+
affiliateId: affiliate_id,
|
17
|
+
applicationId: application_id
|
18
|
+
}
|
19
|
+
end
|
14
20
|
|
15
21
|
before do
|
16
22
|
RakutenWebService.configure do |c|
|
@@ -26,25 +32,48 @@ describe RakutenWebService::Recipe do
|
|
26
32
|
end
|
27
33
|
|
28
34
|
describe '.ranking' do
|
29
|
-
|
35
|
+
context 'get ranking without category_id' do
|
36
|
+
before do
|
37
|
+
response = JSON.parse(fixture('recipe/ranking.json'))
|
38
|
+
|
39
|
+
@expected_request = stub_request(:get, endpoint).
|
40
|
+
with(query: expected_query_without_category_id).
|
41
|
+
to_return(body: response.to_json)
|
42
|
+
end
|
30
43
|
|
31
|
-
|
32
|
-
response = JSON.parse(fixture('recipe/ranking.json'))
|
44
|
+
subject { RakutenWebService::Recipe.ranking }
|
33
45
|
|
34
|
-
|
35
|
-
|
36
|
-
|
46
|
+
it 'should call search without category_id' do
|
47
|
+
subject.first
|
48
|
+
|
49
|
+
expect(@expected_request).to have_been_made.once
|
50
|
+
end
|
51
|
+
it 'should return an array of Recipe' do
|
52
|
+
expect(subject).to be_all { |r| r.is_a?(RWS::Recipe) }
|
53
|
+
end
|
37
54
|
end
|
38
55
|
|
39
|
-
|
56
|
+
context 'get ranking with category_id' do
|
57
|
+
let(:category_id) { '30' }
|
40
58
|
|
41
|
-
|
42
|
-
|
59
|
+
before do
|
60
|
+
response = JSON.parse(fixture('recipe/ranking.json'))
|
43
61
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
62
|
+
@expected_request = stub_request(:get, endpoint).
|
63
|
+
with(query: expected_query).
|
64
|
+
to_return(body: response.to_json)
|
65
|
+
end
|
66
|
+
|
67
|
+
subject { RakutenWebService::Recipe.ranking(category_id) }
|
68
|
+
|
69
|
+
it 'should call search with category_id' do
|
70
|
+
subject.first
|
71
|
+
|
72
|
+
expect(@expected_request).to have_been_made.once
|
73
|
+
end
|
74
|
+
it 'should return an array of Recipe' do
|
75
|
+
expect(subject).to be_all { |r| r.is_a?(RWS::Recipe) }
|
76
|
+
end
|
48
77
|
end
|
49
78
|
end
|
50
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rakuten_web_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tatsuya Sato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
207
|
rubyforge_project:
|
208
|
-
rubygems_version: 2.
|
208
|
+
rubygems_version: 2.6.11
|
209
209
|
signing_key:
|
210
210
|
specification_version: 4
|
211
211
|
summary: Ruby Client for Rakuten Web Service
|