marvelite 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -2
- data/lib/marvelite/api/config/v1.yml +24 -6
- data/lib/marvelite/version.rb +1 -1
- data/spec/fixtures/stories/stories.json +1253 -0
- data/spec/fixtures/stories/story.json +93 -0
- data/spec/fixtures/stories/story_characters.json +789 -0
- data/spec/fixtures/stories/story_comics.json +201 -0
- data/spec/fixtures/stories/story_creators.json +333 -0
- data/spec/fixtures/stories/story_events.json +519 -0
- data/spec/marvelite/api/client_series_endpoints_spec.rb +20 -20
- data/spec/marvelite/api/client_stories_endpoints_spec.rb +115 -0
- metadata +15 -1
@@ -43,16 +43,16 @@ describe Marvelite::API::Client do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'returns a Marvelite::API::Response object' do
|
46
|
-
expect(client.
|
46
|
+
expect(client.series_characters(2069)).to be_a(Marvelite::API::Response)
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'Response object is populated with JSON from the series endpoint' do
|
50
|
-
expect(client.
|
51
|
-
expect(client.
|
50
|
+
expect(client.series_characters(2069)["status"]).to eq("Ok")
|
51
|
+
expect(client.series_characters(2069)[:data][:results].size).to eq(16)
|
52
52
|
end
|
53
53
|
|
54
54
|
it 'accepts an Integer as serie id' do
|
55
|
-
expect(client.
|
55
|
+
expect(client.series_characters(2069)[:data][:results][0][:name]).to eq('Adam Warlock')
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -62,16 +62,16 @@ describe Marvelite::API::Client do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'returns a Marvelite::API::Response object' do
|
65
|
-
expect(client.
|
65
|
+
expect(client.series_comics(2069)).to be_a(Marvelite::API::Response)
|
66
66
|
end
|
67
67
|
|
68
68
|
it 'Response object is populated with JSON from the series endpoint' do
|
69
|
-
expect(client.
|
70
|
-
expect(client.
|
69
|
+
expect(client.series_comics(2069)["status"]).to eq("Ok")
|
70
|
+
expect(client.series_comics(2069)[:data][:results].size).to eq(20)
|
71
71
|
end
|
72
72
|
|
73
73
|
it 'accepts an Integer as serie id' do
|
74
|
-
expect(client.
|
74
|
+
expect(client.series_comics(2069)[:data][:results][0][:title]).to eq('Spider-Man (1990) #98')
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -81,16 +81,16 @@ describe Marvelite::API::Client do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
it 'returns a Marvelite::API::Response object' do
|
84
|
-
expect(client.
|
84
|
+
expect(client.series_creators(2069)).to be_a(Marvelite::API::Response)
|
85
85
|
end
|
86
86
|
|
87
87
|
it 'Response object is populated with JSON from the series endpoint' do
|
88
|
-
expect(client.
|
89
|
-
expect(client.
|
88
|
+
expect(client.series_creators(2069)["status"]).to eq("Ok")
|
89
|
+
expect(client.series_creators(2069)[:data][:results].size).to eq(20)
|
90
90
|
end
|
91
91
|
|
92
92
|
it 'accepts an Integer as serie id' do
|
93
|
-
expect(client.
|
93
|
+
expect(client.series_creators(2069)[:data][:results][0][:fullName]).to eq('Comicraft')
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -100,16 +100,16 @@ describe Marvelite::API::Client do
|
|
100
100
|
end
|
101
101
|
|
102
102
|
it 'returns a Marvelite::API::Response object' do
|
103
|
-
expect(client.
|
103
|
+
expect(client.series_events(2069)).to be_a(Marvelite::API::Response)
|
104
104
|
end
|
105
105
|
|
106
106
|
it 'Response object is populated with JSON from the series endpoint' do
|
107
|
-
expect(client.
|
108
|
-
expect(client.
|
107
|
+
expect(client.series_events(2069)["status"]).to eq("Ok")
|
108
|
+
expect(client.series_events(2069)[:data][:results].size).to eq(3)
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'accepts an Integer as serie id' do
|
112
|
-
expect(client.
|
112
|
+
expect(client.series_events(2069)[:data][:results][0][:title]).to eq('Infinity War')
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
@@ -119,16 +119,16 @@ describe Marvelite::API::Client do
|
|
119
119
|
end
|
120
120
|
|
121
121
|
it 'returns a Marvelite::API::Response object' do
|
122
|
-
expect(client.
|
122
|
+
expect(client.series_stories(2069)).to be_a(Marvelite::API::Response)
|
123
123
|
end
|
124
124
|
|
125
125
|
it 'Response object is populated with JSON from the series endpoint' do
|
126
|
-
expect(client.
|
127
|
-
expect(client.
|
126
|
+
expect(client.series_stories(2069)["status"]).to eq("Ok")
|
127
|
+
expect(client.series_stories(2069)[:data][:results].size).to eq(20)
|
128
128
|
end
|
129
129
|
|
130
130
|
it 'accepts an Integer as serie id' do
|
131
|
-
expect(client.
|
131
|
+
expect(client.series_stories(2069)[:data][:results][0][:title]).to eq('Cover #23741')
|
132
132
|
end
|
133
133
|
end
|
134
134
|
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Marvelite::API::Client do
|
4
|
+
context "Stories Endpoints" do
|
5
|
+
let(:client) { marvelite_test_client }
|
6
|
+
|
7
|
+
describe '#stories' do
|
8
|
+
before do
|
9
|
+
stub_get('stories?apikey=123456&ts=1&hash=d4f1bab013916a533ef31e3ad5fb0887', 'stories/stories.json')
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'returns a Marvelite::API::Response object' do
|
13
|
+
expect(client.stories).to be_a(Marvelite::API::Response)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'Response object is populated with JSON from the stories endpoint' do
|
17
|
+
expect(client.stories["status"]).to eq("Ok")
|
18
|
+
expect(client.stories[:data][:results].size).to eq(20)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#story' do
|
23
|
+
before do
|
24
|
+
stub_get('stories/2210?apikey=123456&ts=1&hash=d4f1bab013916a533ef31e3ad5fb0887', 'stories/story.json')
|
25
|
+
end
|
26
|
+
it 'returns a Marvelite::API::Response object' do
|
27
|
+
expect(client.story(2210)).to be_a(Marvelite::API::Response)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'Response object is populated with JSON from the story endpoint' do
|
31
|
+
expect(client.story(2210)[:data][:results][0][:title]).to eq('2 of 3 - House of M')
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'accepts an Integer as story id' do
|
35
|
+
expect(client.story(2210)[:data][:results][0][:title]).to eq('2 of 3 - House of M')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#story_characters' do
|
40
|
+
before do
|
41
|
+
stub_get('stories/2210/characters?apikey=123456&ts=1&hash=d4f1bab013916a533ef31e3ad5fb0887', 'stories/story_characters.json')
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'returns a Marvelite::API::Response object' do
|
45
|
+
expect(client.story_characters(2210)).to be_a(Marvelite::API::Response)
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'Response object is populated with JSON from the stories endpoint' do
|
49
|
+
expect(client.story_characters(2210)["status"]).to eq("Ok")
|
50
|
+
expect(client.story_characters(2210)[:data][:results].size).to eq(3)
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'accepts an Integer as story id' do
|
54
|
+
expect(client.story_characters(2210)[:data][:results][0][:name]).to eq('Mystique (House of M)')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#story_comics' do
|
59
|
+
before do
|
60
|
+
stub_get('stories/2210/comics?apikey=123456&ts=1&hash=d4f1bab013916a533ef31e3ad5fb0887', 'stories/story_comics.json')
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'returns a Marvelite::API::Response object' do
|
64
|
+
expect(client.story_comics(2210)).to be_a(Marvelite::API::Response)
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'Response object is populated with JSON from the stories endpoint' do
|
68
|
+
expect(client.story_comics(2210)["status"]).to eq("Ok")
|
69
|
+
expect(client.story_comics(2210)[:data][:results].size).to eq(1)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'accepts an Integer as story id' do
|
73
|
+
expect(client.story_comics(2210)[:data][:results][0][:title]).to eq('Wolverine (2003) #34')
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe '#story_creators' do
|
78
|
+
before do
|
79
|
+
stub_get('stories/2210/creators?apikey=123456&ts=1&hash=d4f1bab013916a533ef31e3ad5fb0887', 'stories/story_creators.json')
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'returns a Marvelite::API::Response object' do
|
83
|
+
expect(client.story_creators(2210)).to be_a(Marvelite::API::Response)
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'Response object is populated with JSON from the stories endpoint' do
|
87
|
+
expect(client.story_creators(2210)["status"]).to eq("Ok")
|
88
|
+
expect(client.story_creators(2210)[:data][:results].size).to eq(1)
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'accepts an Integer as story id' do
|
92
|
+
expect(client.story_creators(2210)[:data][:results][0][:fullName]).to eq('Kaare Andrews')
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
describe '#story_events' do
|
97
|
+
before do
|
98
|
+
stub_get('stories/2210/events?apikey=123456&ts=1&hash=d4f1bab013916a533ef31e3ad5fb0887', 'stories/story_events.json')
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'returns a Marvelite::API::Response object' do
|
102
|
+
expect(client.story_events(2210)).to be_a(Marvelite::API::Response)
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'Response object is populated with JSON from the stories endpoint' do
|
106
|
+
expect(client.story_events(2210)["status"]).to eq("Ok")
|
107
|
+
expect(client.story_events(2210)[:data][:results].size).to eq(1)
|
108
|
+
end
|
109
|
+
|
110
|
+
it 'accepts an Integer as story id' do
|
111
|
+
expect(client.story_events(2210)[:data][:results][0][:title]).to eq('House of M')
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marvelite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Antillon
|
@@ -161,11 +161,18 @@ files:
|
|
161
161
|
- spec/fixtures/series/serie_events.json
|
162
162
|
- spec/fixtures/series/serie_stories.json
|
163
163
|
- spec/fixtures/series/series.json
|
164
|
+
- spec/fixtures/stories/stories.json
|
165
|
+
- spec/fixtures/stories/story.json
|
166
|
+
- spec/fixtures/stories/story_characters.json
|
167
|
+
- spec/fixtures/stories/story_comics.json
|
168
|
+
- spec/fixtures/stories/story_creators.json
|
169
|
+
- spec/fixtures/stories/story_events.json
|
164
170
|
- spec/marvelite/api/client_characters_endpoints_spec.rb
|
165
171
|
- spec/marvelite/api/client_comics_endpoints_spec.rb
|
166
172
|
- spec/marvelite/api/client_events_endpoints_spec.rb
|
167
173
|
- spec/marvelite/api/client_series_endpoints_spec.rb
|
168
174
|
- spec/marvelite/api/client_spec.rb
|
175
|
+
- spec/marvelite/api/client_stories_endpoints_spec.rb
|
169
176
|
- spec/marvelite/api/router_spec.rb
|
170
177
|
- spec/spec_helper.rb
|
171
178
|
- CHANGELOG.md
|
@@ -224,10 +231,17 @@ test_files:
|
|
224
231
|
- spec/fixtures/series/serie_events.json
|
225
232
|
- spec/fixtures/series/serie_stories.json
|
226
233
|
- spec/fixtures/series/series.json
|
234
|
+
- spec/fixtures/stories/stories.json
|
235
|
+
- spec/fixtures/stories/story.json
|
236
|
+
- spec/fixtures/stories/story_characters.json
|
237
|
+
- spec/fixtures/stories/story_comics.json
|
238
|
+
- spec/fixtures/stories/story_creators.json
|
239
|
+
- spec/fixtures/stories/story_events.json
|
227
240
|
- spec/marvelite/api/client_characters_endpoints_spec.rb
|
228
241
|
- spec/marvelite/api/client_comics_endpoints_spec.rb
|
229
242
|
- spec/marvelite/api/client_events_endpoints_spec.rb
|
230
243
|
- spec/marvelite/api/client_series_endpoints_spec.rb
|
231
244
|
- spec/marvelite/api/client_spec.rb
|
245
|
+
- spec/marvelite/api/client_stories_endpoints_spec.rb
|
232
246
|
- spec/marvelite/api/router_spec.rb
|
233
247
|
- spec/spec_helper.rb
|