growviral-warehouse 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/warehouse/checks_follow_history.rb +2 -3
- data/lib/warehouse/version.rb +1 -1
- data/test/checks_follow_history_test.rb +13 -3
- data/test/test_helper.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a2f6790466c52e2e681c7e53b7a3e8fc29f5dc1
|
4
|
+
data.tar.gz: 6015b3bb3d1832f80f9e168393d972d5208a7321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c43c8cd42ba7798599e98c691fdbaf14b40b679af3d8e1462ef0535b2e378f4484dbe667753f190e1b9d9646d404411144904d357dcc248522c1869f8c427388
|
7
|
+
data.tar.gz: abf45a7742b76c76f65763ebf155d5980855f54d4d4f22c0dcf1a78fde43a1634f7df51481c0adca1bab1c0b2ce770d6fb897d14b766e4a2af73f2900fd6d20d
|
@@ -13,8 +13,8 @@ module GrowViral
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def exists?
|
16
|
-
response = Net::HTTP.
|
17
|
-
if response.
|
16
|
+
response = Net::HTTP.get_response(uri)
|
17
|
+
if response.code.to_i == 200
|
18
18
|
true
|
19
19
|
else
|
20
20
|
false
|
@@ -27,4 +27,3 @@ module GrowViral
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
data/lib/warehouse/version.rb
CHANGED
@@ -7,11 +7,21 @@ class ChecksFollowHistoryTest < Minitest::Test
|
|
7
7
|
|
8
8
|
uri = URI.parse("http://localhost:3000/follows?handle=#{handle}&following_handle=#{following_handle}")
|
9
9
|
|
10
|
-
Net::HTTP.expects(:
|
10
|
+
Net::HTTP.expects(:get_response).with(uri).returns(mock(code: '200'))
|
11
11
|
|
12
12
|
client = GrowViral::Warehouse::Client.new(:development)
|
13
|
-
|
13
|
+
assert client.has_follow_history?(handle, following_handle)
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_false_for_404
|
17
|
+
handle = "foobar"
|
18
|
+
following_handle = "barfoo"
|
14
19
|
|
15
|
-
|
20
|
+
uri = URI.parse("http://localhost:3000/follows?handle=#{handle}&following_handle=#{following_handle}")
|
21
|
+
|
22
|
+
Net::HTTP.expects(:get_response).with(uri).returns(mock(code: '404'))
|
23
|
+
|
24
|
+
client = GrowViral::Warehouse::Client.new(:development)
|
25
|
+
refute client.has_follow_history?(handle, following_handle)
|
16
26
|
end
|
17
27
|
end
|
data/test/test_helper.rb
CHANGED