lita-catme 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita-catme.rb +0 -1
- data/lib/lita/handlers/cat.rb +30 -11
- data/lib/lita/handlers/catme.rb +0 -2
- data/lita-catme.gemspec +1 -2
- data/spec/fixtures/vcr_cassettes/fetch_cat.yml +57 -52
- data/spec/fixtures/vcr_cassettes/fetch_multiple_cats.yml +57 -97
- data/spec/fixtures/vcr_cassettes/fetch_with_category.yml +57 -52
- data/spec/lita/handlers/cat_spec.rb +3 -3
- metadata +1 -17
- data/spec/fixtures/vcr_cassettes/fetch_with_invalid_category.yml +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a466b67acaa35ef3d8495087458ae691519a3d180f640ff25dbfd8e5d9bb8e7
|
4
|
+
data.tar.gz: 687e467213f7429b7e85c1be3833534ab327605071b0a5ed9f73123a62bdb266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b75144a0754a6d39631bf0f3bb1b57268745dfa7268d0d0420c72891c5361df0c8ebf65634dba54baf07cef3f2e7f3fdf6621ad63d4562b901ab31ba4cb7ef08
|
7
|
+
data.tar.gz: a8ee57256b738aee69b276960bbaf74dccd201e993e1a9928c9789f26a2e096f5712ce69691545167d0fcd6a305465fed9fbd4a0305b83d5df5ab78fe3db1b7b
|
data/lib/lita-catme.rb
CHANGED
data/lib/lita/handlers/cat.rb
CHANGED
@@ -1,26 +1,45 @@
|
|
1
|
-
|
2
1
|
module Lita
|
3
2
|
module Handlers
|
4
3
|
class Cat
|
5
|
-
BASE_URL = 'http://api.thecatapi.com/
|
4
|
+
BASE_URL = 'http://api.thecatapi.com/v1'.freeze
|
5
|
+
CATEGORIES = {
|
6
|
+
hats: 1,
|
7
|
+
space: 2,
|
8
|
+
funny: 3,
|
9
|
+
sunglasses: 4,
|
10
|
+
boxes: 5,
|
11
|
+
caturday: 6,
|
12
|
+
ties: 7,
|
13
|
+
dream: 9,
|
14
|
+
kittens: 10,
|
15
|
+
sinks: 14,
|
16
|
+
clothes: 15,
|
17
|
+
}
|
18
|
+
|
6
19
|
attr_accessor :url
|
7
20
|
|
8
21
|
class << self
|
9
22
|
def fetch(count: nil, category: nil)
|
10
|
-
url = "#{BASE_URL}/images/
|
11
|
-
url += "&
|
12
|
-
|
23
|
+
url = "#{BASE_URL}/images/search?format=json"
|
24
|
+
url += "&limit=#{count}" unless count.nil?
|
25
|
+
if category.present?
|
26
|
+
return [] unless valid_category?(category)
|
27
|
+
url += "&category_ids=#{CATEGORIES[category.to_sym]}"
|
28
|
+
end
|
13
29
|
|
14
|
-
|
15
|
-
cats << new(cat
|
30
|
+
JSON.parse(open(url) { |io| io.read }).each_with_object([]) do |cat, cats|
|
31
|
+
cats << new(cat["url"])
|
16
32
|
end
|
17
33
|
end
|
18
34
|
|
19
35
|
def fetch_categories
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
36
|
+
CATEGORIES.keys.map(&:to_s)
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def valid_category?(category)
|
42
|
+
fetch_categories.include?(category)
|
24
43
|
end
|
25
44
|
end
|
26
45
|
|
data/lib/lita/handlers/catme.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
module Lita
|
2
2
|
module Handlers
|
3
3
|
class Catme < Handler
|
4
|
-
BASE_URL = 'http://thecatapi.com/api/images/get'.freeze
|
5
|
-
|
6
4
|
route(/^cat( me)?$/i, :cat_me, command: true, help: { 'cat me' => t('help.cat_me') })
|
7
5
|
route(/^cat bomb( (\d+))?$/i, :cat_bomb, command: true, help: { 'cat bomb N' => t('help.cat_bomb') })
|
8
6
|
route(/^cat categories$/i, :cat_categories, command: true, help: { 'cat categories' => t('help.cat_categories') })
|
data/lita-catme.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-catme"
|
3
|
-
spec.version = "0.
|
3
|
+
spec.version = "0.3.0"
|
4
4
|
spec.authors = ["Emile Filteau"]
|
5
5
|
spec.email = ["emile.filteau@gmail.com"]
|
6
6
|
spec.description = %q(A lita handler that fetch random cat images)
|
@@ -15,7 +15,6 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.require_paths = ["lib"]
|
16
16
|
|
17
17
|
spec.add_runtime_dependency "lita", "~> 4.7"
|
18
|
-
spec.add_dependency "nokogiri", "~> 1.8.4"
|
19
18
|
|
20
19
|
spec.add_development_dependency "bundler", "~> 1.3"
|
21
20
|
spec.add_development_dependency "pry-byebug"
|
@@ -1,53 +1,58 @@
|
|
1
|
+
---
|
1
2
|
http_interactions:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.thecatapi.com/v1/images/search?format=json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Tue, 18 Sep 2018 14:31:44 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
Transfer-Encoding:
|
26
|
+
- chunked
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Server:
|
30
|
+
- nginx/1.12.1
|
31
|
+
X-Dns-Prefetch-Control:
|
32
|
+
- 'off'
|
33
|
+
X-Frame-Options:
|
34
|
+
- SAMEORIGIN
|
35
|
+
Strict-Transport-Security:
|
36
|
+
- max-age=15552000; includeSubDomains
|
37
|
+
X-Download-Options:
|
38
|
+
- noopen
|
39
|
+
X-Content-Type-Options:
|
40
|
+
- nosniff
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
Vary:
|
44
|
+
- Origin
|
45
|
+
Expires:
|
46
|
+
- Tue, 03 Jul 2001 06:00:00 GMT
|
47
|
+
Last-Modified:
|
48
|
+
- Tue Sep 18 2018 14:31:44 GMT+0000 (UTC)
|
49
|
+
Cache-Control:
|
50
|
+
- post-check=0, pre-check=0
|
51
|
+
X-Response-Time:
|
52
|
+
- 28ms
|
53
|
+
body:
|
54
|
+
encoding: ASCII-8BIT
|
55
|
+
string: '[{"id":"78j","url":"https://24.media.tumblr.com/tumblr_m0mjqs3zeu1r6b7kmo1_500.jpg","breeds":[],"categories":[]}]'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Tue, 18 Sep 2018 14:31:44 GMT
|
58
|
+
recorded_with: VCR 4.0.0
|
@@ -1,98 +1,58 @@
|
|
1
|
+
---
|
1
2
|
http_interactions:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<image>
|
59
|
-
<url>http://24.media.tumblr.com/tumblr_lgqhdsGcgO1qfyzelo1_500.jpg</url>
|
60
|
-
<id>6s0</id>
|
61
|
-
<source_url>http://thecatapi.com/?id=6s0</source_url>
|
62
|
-
</image>
|
63
|
-
<image>
|
64
|
-
<url>http://25.media.tumblr.com/tumblr_m22h2qhwn61qcxyrro1_500.jpg</url>
|
65
|
-
<id>atp</id>
|
66
|
-
<source_url>http://thecatapi.com/?id=atp</source_url>
|
67
|
-
</image>
|
68
|
-
<image>
|
69
|
-
<url>http://24.media.tumblr.com/tumblr_lwidfjYoSI1qlyuwso1_1280.jpg</url>
|
70
|
-
<id>925</id>
|
71
|
-
<source_url>http://thecatapi.com/?id=925</source_url>
|
72
|
-
</image>
|
73
|
-
<image>
|
74
|
-
<url>http://25.media.tumblr.com/tumblr_luowluVKdx1qdth8zo1_1280.jpg</url>
|
75
|
-
<id>cev</id>
|
76
|
-
<source_url>http://thecatapi.com/?id=cev</source_url>
|
77
|
-
</image>
|
78
|
-
<image>
|
79
|
-
<url>http://24.media.tumblr.com/tumblr_m4pwtpa2Nw1r6jd7fo1_500.jpg</url>
|
80
|
-
<id>eb9</id>
|
81
|
-
<source_url>http://thecatapi.com/?id=eb9</source_url>
|
82
|
-
</image>
|
83
|
-
<image>
|
84
|
-
<url>http://24.media.tumblr.com/tumblr_lr8ng062t01qhwlspo1_500.jpg</url>
|
85
|
-
<id>53s</id>
|
86
|
-
<source_url>http://thecatapi.com/?id=53s</source_url>
|
87
|
-
</image>
|
88
|
-
<image>
|
89
|
-
<url>http://25.media.tumblr.com/tumblr_m33ib9ERyW1qflacro1_1280.jpg</url>
|
90
|
-
<id>9me</id>
|
91
|
-
<source_url>http://thecatapi.com/?id=9me</source_url>
|
92
|
-
</image>
|
93
|
-
</images>
|
94
|
-
</data>
|
95
|
-
</response>
|
96
|
-
? http_version
|
97
|
-
recorded_at: Tue, 12 Apr 2016 16:06:10 GMT
|
98
|
-
recorded_with: VCR 3.0.1
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.thecatapi.com/v1/images/search?format=json&limit=10
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Tue, 18 Sep 2018 14:32:20 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
Transfer-Encoding:
|
26
|
+
- chunked
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Server:
|
30
|
+
- nginx/1.12.1
|
31
|
+
X-Dns-Prefetch-Control:
|
32
|
+
- 'off'
|
33
|
+
X-Frame-Options:
|
34
|
+
- SAMEORIGIN
|
35
|
+
Strict-Transport-Security:
|
36
|
+
- max-age=15552000; includeSubDomains
|
37
|
+
X-Download-Options:
|
38
|
+
- noopen
|
39
|
+
X-Content-Type-Options:
|
40
|
+
- nosniff
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
Vary:
|
44
|
+
- Origin
|
45
|
+
Expires:
|
46
|
+
- Tue, 03 Jul 2001 06:00:00 GMT
|
47
|
+
Last-Modified:
|
48
|
+
- Tue Sep 18 2018 14:32:20 GMT+0000 (UTC)
|
49
|
+
Cache-Control:
|
50
|
+
- post-check=0, pre-check=0
|
51
|
+
X-Response-Time:
|
52
|
+
- 28ms
|
53
|
+
body:
|
54
|
+
encoding: ASCII-8BIT
|
55
|
+
string: '[{"id":"5gg","url":"https://25.media.tumblr.com/tumblr_lt95ovYgPG1r4xjo2o1_500.jpg","breeds":[],"categories":[]},{"id":"39a","url":"https://25.media.tumblr.com/tumblr_ltwqocDfjo1qdvbl3o1_500.jpg","breeds":[],"categories":[]},{"id":"80j","url":"https://25.media.tumblr.com/tumblr_lel3kmDMRE1qcn249o1_250.gif","breeds":[],"categories":[]},{"id":"v1","url":"https://27.media.tumblr.com/tumblr_m1pgvd5CPM1qjahcpo1_500.jpg","breeds":[],"categories":[]},{"id":"1bh","url":"https://24.media.tumblr.com/tumblr_m3brelrcMw1qzulfbo1_500.jpg","breeds":[],"categories":[]},{"id":"bt","url":"https://24.media.tumblr.com/ZabOTt2mpdp8cpiurcr3ZTxy_400.jpg","breeds":[],"categories":[]},{"id":"2ib","url":"https://25.media.tumblr.com/tumblr_m3ibz8iESF1r6b7kmo1_500.jpg","breeds":[],"categories":[]},{"id":"18l","url":"https://cdn2.thecatapi.com/images/18l.gif","breeds":[],"categories":[]},{"id":"85d","url":"https://24.media.tumblr.com/tumblr_lx0csyDRUL1qdlh1io1_250.gif","breeds":[],"categories":[]},{"id":"15r","url":"https://25.media.tumblr.com/ZabOTt2mpelinebllqGw8kAZo1_500.jpg","breeds":[],"categories":[]}]'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Tue, 18 Sep 2018 14:32:20 GMT
|
58
|
+
recorded_with: VCR 4.0.0
|
@@ -1,53 +1,58 @@
|
|
1
|
+
---
|
1
2
|
http_interactions:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.thecatapi.com/v1/images/search?category_ids=5&format=json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Tue, 18 Sep 2018 14:53:55 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
Transfer-Encoding:
|
26
|
+
- chunked
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Server:
|
30
|
+
- nginx/1.12.1
|
31
|
+
X-Dns-Prefetch-Control:
|
32
|
+
- 'off'
|
33
|
+
X-Frame-Options:
|
34
|
+
- SAMEORIGIN
|
35
|
+
Strict-Transport-Security:
|
36
|
+
- max-age=15552000; includeSubDomains
|
37
|
+
X-Download-Options:
|
38
|
+
- noopen
|
39
|
+
X-Content-Type-Options:
|
40
|
+
- nosniff
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
Vary:
|
44
|
+
- Origin
|
45
|
+
Expires:
|
46
|
+
- Tue, 03 Jul 2001 06:00:00 GMT
|
47
|
+
Last-Modified:
|
48
|
+
- Tue Sep 18 2018 14:53:55 GMT+0000 (UTC)
|
49
|
+
Cache-Control:
|
50
|
+
- post-check=0, pre-check=0
|
51
|
+
X-Response-Time:
|
52
|
+
- 25ms
|
53
|
+
body:
|
54
|
+
encoding: ASCII-8BIT
|
55
|
+
string: '[{"id":"ed","url":"https://28.media.tumblr.com/tumblr_lwa29aW9RO1r0mbi6o1_500.jpg","breeds":[],"categories":[]}]'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Tue, 18 Sep 2018 14:53:55 GMT
|
58
|
+
recorded_with: VCR 4.0.0
|
@@ -11,7 +11,7 @@ describe Lita::Handlers::Cat do
|
|
11
11
|
it 'returns an array containing one cat' do
|
12
12
|
cats = described_class.fetch
|
13
13
|
expect(cats.length).to eq(1)
|
14
|
-
expect(cats.first.url).to eq("
|
14
|
+
expect(cats.first.url).to eq("https://24.media.tumblr.com/tumblr_m0mjqs3zeu1r6b7kmo1_500.jpg")
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -38,11 +38,11 @@ describe Lita::Handlers::Cat do
|
|
38
38
|
it 'returns an array containing one cat in the given category' do
|
39
39
|
cats = described_class.fetch(category: 'boxes')
|
40
40
|
expect(cats.length).to eq(1)
|
41
|
-
expect(cats.first.url).to eq("
|
41
|
+
expect(cats.first.url).to eq("https://28.media.tumblr.com/tumblr_lwa29aW9RO1r0mbi6o1_500.jpg")
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
context 'with category argument set to invalid value'
|
45
|
+
context 'with category argument set to invalid value' do
|
46
46
|
it 'instaniate no cat object' do
|
47
47
|
expect(described_class).to receive(:new).never
|
48
48
|
described_class.fetch(category: 'foobar')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-catme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emile Filteau
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.7'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: nokogiri
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.8.4
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.8.4
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,7 +157,6 @@ files:
|
|
171
157
|
- spec/fixtures/vcr_cassettes/fetch_cat.yml
|
172
158
|
- spec/fixtures/vcr_cassettes/fetch_multiple_cats.yml
|
173
159
|
- spec/fixtures/vcr_cassettes/fetch_with_category.yml
|
174
|
-
- spec/fixtures/vcr_cassettes/fetch_with_invalid_category.yml
|
175
160
|
- spec/lita/handlers/cat_spec.rb
|
176
161
|
- spec/lita/handlers/catme_spec.rb
|
177
162
|
- spec/spec_helper.rb
|
@@ -205,7 +190,6 @@ test_files:
|
|
205
190
|
- spec/fixtures/vcr_cassettes/fetch_cat.yml
|
206
191
|
- spec/fixtures/vcr_cassettes/fetch_multiple_cats.yml
|
207
192
|
- spec/fixtures/vcr_cassettes/fetch_with_category.yml
|
208
|
-
- spec/fixtures/vcr_cassettes/fetch_with_invalid_category.yml
|
209
193
|
- spec/lita/handlers/cat_spec.rb
|
210
194
|
- spec/lita/handlers/catme_spec.rb
|
211
195
|
- spec/spec_helper.rb
|
@@ -1,47 +0,0 @@
|
|
1
|
-
http_interactions:
|
2
|
-
- request:
|
3
|
-
method: get
|
4
|
-
uri: http://api.thecatapi.com/api/images/get?category=foobar&format=xml
|
5
|
-
body:
|
6
|
-
encoding: US-ASCII
|
7
|
-
string: ""
|
8
|
-
headers:
|
9
|
-
Accept-Encoding:
|
10
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
11
|
-
Accept:
|
12
|
-
- "*/*"
|
13
|
-
User-Agent:
|
14
|
-
- Ruby
|
15
|
-
response:
|
16
|
-
status:
|
17
|
-
code: 200
|
18
|
-
message: OK
|
19
|
-
headers:
|
20
|
-
Date:
|
21
|
-
- Tue, 12 Apr 2016 16:18:16 GMT
|
22
|
-
Server:
|
23
|
-
- Apache
|
24
|
-
X-Powered-By:
|
25
|
-
- PHP/5.4.45
|
26
|
-
Access-Control-Allow-Origin:
|
27
|
-
- "*"
|
28
|
-
Access-Control-Allow-Methods:
|
29
|
-
- GET, POST
|
30
|
-
Access-Control-Allow-Headers:
|
31
|
-
- X-Requested-With
|
32
|
-
Transfer-Encoding:
|
33
|
-
- chunked
|
34
|
-
Content-Type:
|
35
|
-
- text/xml
|
36
|
-
body:
|
37
|
-
encoding: UTF-8
|
38
|
-
string: |
|
39
|
-
<?xml version="1.0"?>
|
40
|
-
<response>
|
41
|
-
<data>
|
42
|
-
<images/>
|
43
|
-
</data>
|
44
|
-
</response>
|
45
|
-
? http_version
|
46
|
-
recorded_at: Tue, 12 Apr 2016 16:18:16 GMT
|
47
|
-
recorded_with: VCR 3.0.1
|