facegroups 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6683c1644378ae169e25ce268c9899d122a3cf63
4
- data.tar.gz: 692247fdcc9b92b57088643fbc6c477eb29d032b
3
+ metadata.gz: 3e8f41736cdb85fec7b1349bf2f64fe4afb4f557
4
+ data.tar.gz: 8ed4f0f04d7beb13660571e5d8ea1ec0450b320b
5
5
  SHA512:
6
- metadata.gz: b8dac5a5fac0c75f826a6d5ae83b62edf28239a8271ba5edfbc9ddb7746e137eee4bd7d344ed1ecae993303cb294800241031703407968074d243309ea75b3f9
7
- data.tar.gz: caf62bdc2cc3c10c585b39c296a979e42302bb6ab417043d0a3bed4be7dc6e02cbb67c99130874fac7d818fadf263695bf06091730c42cfed549f8bf128bd9af
6
+ metadata.gz: 04e90b92efdb18cba02f9b26543a95a7257a7d33bfe37838c3fad560ee0593dda69a426ecc360dabb076c0124ab1f59bdd78f3fc4afdbfe161ae06cc16fbcf23
7
+ data.tar.gz: 095d23ab0c7c784c46db419fa18faf760e2ec0438c61b64fa7c8e1cc90e6ece79fe4865247a8d9959d66fdc74e33a0743683ca5d9d4b9f394e603766102276ca
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- facegroups (0.5.0)
4
+ facegroups (0.6.0)
5
5
  http (~> 2.0)
6
6
 
7
7
  GEM
@@ -11,12 +11,10 @@ module FaceGroups
11
11
  TOKEN_KEY = 'fbapi_access_token'
12
12
 
13
13
  GRAPH_QUERY = {
14
- group:
15
- 'id,name,feed{name,message,updated_time,created_time,'\
16
- 'attachments{title,description,url,media}}',
17
- posting:
18
- 'name,message,updated_time,created_time,'\
19
- 'attachments{title,description,url,media}'
14
+ group: 'id,name,feed{name,message,updated_time,created_time,'\
15
+ 'attachments{title,description,url,media}}',
16
+ posting: 'name,message,updated_time,created_time,'\
17
+ 'attachments{title,description,url,media}'
20
18
  }.freeze
21
19
 
22
20
  def self.access_token
@@ -18,9 +18,8 @@ module FaceGroups
18
18
  group_data.include?('error') ? nil : new(group_data: group_data)
19
19
  end
20
20
 
21
- def latest_posting_time
22
- latest_postings = FbApi.newest_group_postings(id)
23
- Time.parse(latest_postings.first['updated_time'])
21
+ def latest_postings
22
+ FbApi.newest_group_postings(id)
24
23
  end
25
24
  end
26
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FaceGroups
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -57,12 +57,12 @@ describe 'Finding Group Information' do
57
57
  end
58
58
  end
59
59
 
60
- describe 'Checking Latest Post Time' do
61
- it '(HAPPY) should get the latest posting time from a group feed' do
62
- group = FaceGroups::Group.find(id: EN['FB_GROUP_ID'])
63
- latest_time = group.latest_posting_time
64
- latest_time.must_be_instance_of Time
65
- latest_time.must_be :<, Time.now
60
+ describe 'Checking Latest Postings on Group Feed' do
61
+ it '(HAPPY) should get only the latest postings time from a group feed' do
62
+ group = FaceGroups::Group.find(id: ENV['FB_GROUP_ID'])
63
+ latest_postings = group.latest_postings
64
+ latest_postings.count.must_be :>=, 10
65
+ latest_postings.count.must_be :<=, 25
66
66
  end
67
67
  end
68
68
  end
@@ -31,13 +31,13 @@ http_interactions:
31
31
  Content-Type:
32
32
  - application/json; charset=UTF-8
33
33
  X-Fb-Trace-Id:
34
- - D1HpQxu168B
34
+ - Bm/5xNVX6AD
35
35
  X-Fb-Rev:
36
36
  - '2714680'
37
37
  X-Fb-Debug:
38
- - ByyQ1oL8PWaUpUEcm5nVrZVqI0R5teotsfKyahK17eLtj4jCMp3ehze5aX5VouywplLMy53vilJT3K4wO1YQ/Q==
38
+ - KzjD6HZIj/DQKG2dedE3r8CwIB51QIu+wQSy+r/rHHxEoP0VbUFiFTLM1hDKHM7okcIpfeVQDrLpUB1U66WeZQ==
39
39
  Date:
40
- - Fri, 02 Dec 2016 05:54:34 GMT
40
+ - Fri, 02 Dec 2016 06:17:44 GMT
41
41
  Connection:
42
42
  - close
43
43
  Content-Length:
@@ -46,5 +46,5 @@ http_interactions:
46
46
  encoding: UTF-8
47
47
  string: '{"access_token":"<ACCESS_TOKEN>","token_type":"bearer"}'
48
48
  http_version:
49
- recorded_at: Fri, 02 Dec 2016 05:54:33 GMT
49
+ recorded_at: Fri, 02 Dec 2016 06:17:42 GMT
50
50
  recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facegroups
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditya Utama Wijaya