growviral-warehouse 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9f4f9a0f76a0802812b225226b4176bf7fca4fd
4
- data.tar.gz: 040873b93c6ffb9cfb631823048acd5658f7343a
3
+ metadata.gz: 4a2f6790466c52e2e681c7e53b7a3e8fc29f5dc1
4
+ data.tar.gz: 6015b3bb3d1832f80f9e168393d972d5208a7321
5
5
  SHA512:
6
- metadata.gz: f3dc2834bb6eed09b9400b7cc0594e5ceb716cf3f63a1325a769ed5fd336410e0b283db44adb05d6d7690510eaa2f0708fd17d1718662992cb5237b476c7f6b4
7
- data.tar.gz: 544525f47d2e4432b070aa31f6988eaeaae5c0f1e32e73c7dc09c8c06e00522e9fb757e763dbd77b3b42b44e2bc037cd53c22c93e4f3555b7e83c4acbc0c9026
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.get(uri)
17
- if response.status == 200
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
-
@@ -1,5 +1,5 @@
1
1
  module GrowViral
2
2
  module Warehouse
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -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(:get).with(uri).returns(mock(status: 200))
10
+ Net::HTTP.expects(:get_response).with(uri).returns(mock(code: '200'))
11
11
 
12
12
  client = GrowViral::Warehouse::Client.new(:development)
13
- actual = client.has_follow_history?(handle, following_handle)
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
- assert_equal true, actual
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
@@ -1,4 +1,4 @@
1
1
  require "minitest/autorun"
2
2
  require 'mocha/mini_test'
3
3
 
4
- require 'growviral-warehouse'
4
+ require 'growviral/warehouse'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: growviral-warehouse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker