groupme 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/groupme.gemspec +1 -1
- data/lib/groupme/members.rb +10 -0
- data/lib/groupme/version.rb +1 -1
- data/spec/fixtures/members.json +24 -0
- data/spec/groupme/members_spec.rb +12 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c3a3b37ebef684284d9b435bd69352c1cdec37a
|
4
|
+
data.tar.gz: 87161fd279fa47022fa56ce8d580e89c6bedc0f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ab20451343b644cb666fbbf052a553997c31a044725616c4c221b687d0f2a3d083a09e984c43bcd2b98d1e99fb942efe0acdcba5d27305ec39449f3fb72f1cf
|
7
|
+
data.tar.gz: fc87384a09d2047d02a8e43d8da34736d358b735bbafb90a28dddde2b46c8bf99ff0b08c3a3a8ab3344268a524f4e806ada9231896102d5d000166db8a196ac7
|
data/groupme.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
21
|
gem.add_development_dependency 'rake'
|
22
|
-
gem.add_development_dependency 'rspec', '~>
|
22
|
+
gem.add_development_dependency 'rspec', '~> 3.0'
|
23
23
|
gem.add_development_dependency 'webmock'
|
24
24
|
gem.add_development_dependency 'yard'
|
25
25
|
gem.add_development_dependency 'pry'
|
data/lib/groupme/members.rb
CHANGED
@@ -41,5 +41,15 @@ module GroupMe
|
|
41
41
|
post("/groups/#{group_id}/members/#{member_id}/remove").status == 200
|
42
42
|
end
|
43
43
|
|
44
|
+
# Get the membership results from an add call
|
45
|
+
#
|
46
|
+
# @return [Array<Hashie::Mash>] Array of hashes representing members
|
47
|
+
# @see https://dev.groupme.com/docs/v3#members_results
|
48
|
+
# @param group_id [String, Integer] Id of the group
|
49
|
+
# @param results_id [String, Integer] Id of the results set
|
50
|
+
def membership_results(group_id, results_id)
|
51
|
+
get("/groups/#{group_id}/members/results/#{results_id}").members
|
52
|
+
end
|
53
|
+
|
44
54
|
end
|
45
55
|
end
|
data/lib/groupme/version.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"members": [
|
3
|
+
{
|
4
|
+
"id": "1000",
|
5
|
+
"user_id": "10000",
|
6
|
+
"nickname": "John",
|
7
|
+
"muted": false,
|
8
|
+
"image_url": "http://i.groupme.com/AVATAR",
|
9
|
+
"autokicked": false,
|
10
|
+
"app_installed": true,
|
11
|
+
"guid": "GUID-1"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"id": "2000",
|
15
|
+
"user_id": "20000",
|
16
|
+
"nickname": "Anne",
|
17
|
+
"muted": false,
|
18
|
+
"image_url": "http://i.groupme.com/AVATAR",
|
19
|
+
"autokicked": false,
|
20
|
+
"app_installed": true,
|
21
|
+
"guid": "GUID-2"
|
22
|
+
}
|
23
|
+
]
|
24
|
+
}
|
@@ -21,6 +21,18 @@ describe GroupMe::Members do
|
|
21
21
|
|
22
22
|
end
|
23
23
|
|
24
|
+
describe '.membership_results' do
|
25
|
+
|
26
|
+
it 'lists membership results from an add call' do
|
27
|
+
stub_get('/groups/123/members/results/456').to_return(json_response('members.json'))
|
28
|
+
response = @client.membership_results(123, 456)
|
29
|
+
expect(response.length).to eq(2)
|
30
|
+
expect(response.first.nickname).to eq('John')
|
31
|
+
expect(response.last.guid).to eq('GUID-2')
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
24
36
|
describe ".add_members" do
|
25
37
|
|
26
38
|
it "adds a list of members to a group" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groupme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Radcliffe
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '3.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: webmock
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,6 +209,7 @@ files:
|
|
209
209
|
- spec/fixtures/former_groups.json
|
210
210
|
- spec/fixtures/group.json
|
211
211
|
- spec/fixtures/groups.json
|
212
|
+
- spec/fixtures/members.json
|
212
213
|
- spec/fixtures/message.json
|
213
214
|
- spec/fixtures/message_with_location.json
|
214
215
|
- spec/fixtures/message_with_one_image.json
|
@@ -253,6 +254,7 @@ test_files:
|
|
253
254
|
- spec/fixtures/former_groups.json
|
254
255
|
- spec/fixtures/group.json
|
255
256
|
- spec/fixtures/groups.json
|
257
|
+
- spec/fixtures/members.json
|
256
258
|
- spec/fixtures/message.json
|
257
259
|
- spec/fixtures/message_with_location.json
|
258
260
|
- spec/fixtures/message_with_one_image.json
|