slack-api 1.1.2 → 1.1.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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +2 -0
  3. data/.rspec +1 -1
  4. data/.travis.yml +5 -0
  5. data/Guardfile +13 -0
  6. data/README.md +4 -0
  7. data/Rakefile +11 -0
  8. data/lib/slack/request.rb +1 -1
  9. data/lib/slack/version.rb +1 -1
  10. data/slack.gemspec +7 -2
  11. data/spec/api_spec.rb +23 -0
  12. data/spec/auth_spec.rb +22 -0
  13. data/spec/channels_spec.rb +247 -0
  14. data/spec/spec_helper.rb +81 -2
  15. data/spec/vcr/Slack_Client/api/test/with_extra_arguments.yml +56 -0
  16. data/spec/vcr/Slack_Client/api/test/with_valid_token.yml +56 -0
  17. data/spec/vcr/Slack_Client/auth/test/with_invalid_token.yml +48 -0
  18. data/spec/vcr/Slack_Client/auth/test/with_valid_token.yml +58 -0
  19. data/spec/vcr/Slack_Client/channels/archive/with_name.yml +58 -0
  20. data/spec/vcr/Slack_Client/channels/create/with_taken_name.yml +58 -0
  21. data/spec/vcr/Slack_Client/channels/create/with_test_channel_name.yml +58 -0
  22. data/spec/vcr/Slack_Client/channels/history/with_name.yml +71 -0
  23. data/spec/vcr/Slack_Client/channels/info/with_name.yml +59 -0
  24. data/spec/vcr/Slack_Client/channels/invite/with_valid_arguments.yml +59 -0
  25. data/spec/vcr/Slack_Client/channels/invite/without_argument_channel_.yml +58 -0
  26. data/spec/vcr/Slack_Client/channels/join/with_name.yml +58 -0
  27. data/spec/vcr/Slack_Client/channels/kick/with_arguments.yml +58 -0
  28. data/spec/vcr/Slack_Client/channels/leave/with_channel.yml +58 -0
  29. data/spec/vcr/Slack_Client/channels/list/with_valid_token.yml +63 -0
  30. data/spec/vcr/Slack_Client/channels/mark/with_argument.yml +58 -0
  31. data/spec/vcr/Slack_Client/channels/rename/with_name.yml +58 -0
  32. data/spec/vcr/Slack_Client/channels/setPurpose/with_arguments.yml +58 -0
  33. data/spec/vcr/Slack_Client/channels/setTopic/with_arguments.yml +58 -0
  34. data/spec/vcr/Slack_Client/channels/unarchive/with_channel.yml +58 -0
  35. metadata +129 -10
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://slack.com/api/channels.info
6
+ body:
7
+ encoding: UTF-8
8
+ string: channel=C04MY3KCY&token=<TOKEN>
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Slack Ruby Gem 1.1.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Cache-Control:
26
+ - private, no-cache, no-store, must-revalidate
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Wed, 06 May 2015 00:23:12 GMT
31
+ Expires:
32
+ - Mon, 26 Jul 1997 05:00:00 GMT
33
+ Pragma:
34
+ - no-cache
35
+ Server:
36
+ - Apache
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains; preload
39
+ Vary:
40
+ - Accept-Encoding
41
+ X-Accepted-Oauth-Scopes:
42
+ - read
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Oauth-Scopes:
46
+ - identify,read,post,client,admin
47
+ X-Xss-Protection:
48
+ - '0'
49
+ Content-Length:
50
+ - '311'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"ok":true,"channel":{"id":"C04MY3KCY","name":"gem_testroom","is_channel":true,"created":1430871124,"creator":"U0399SL90","is_archived":false,"is_general":false,"is_member":true,"last_read":"1430871394.000003","latest":{"user":"U0399SL90","inviter":"U03LM2UM7","type":"message","subtype":"channel_join","text":"<@U0399SL90|aki017>
56
+ has joined the channel","ts":"1430871766.000006"},"unread_count":5,"unread_count_display":1,"members":["U0399SL90","U03LM2UM7"],"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"","creator":"","last_set":0}}}'
57
+ http_version:
58
+ recorded_at: Wed, 06 May 2015 00:23:12 GMT
59
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://slack.com/api/channels.invite
6
+ body:
7
+ encoding: UTF-8
8
+ string: channel=C04MY3KCY&token=<TOKEN>&user=U0399SL90
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Slack Ruby Gem 1.1.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Cache-Control:
26
+ - private, no-cache, no-store, must-revalidate
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Wed, 06 May 2015 00:22:46 GMT
31
+ Expires:
32
+ - Mon, 26 Jul 1997 05:00:00 GMT
33
+ Pragma:
34
+ - no-cache
35
+ Server:
36
+ - Apache
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains; preload
39
+ Vary:
40
+ - Accept-Encoding
41
+ X-Accepted-Oauth-Scopes:
42
+ - post
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Oauth-Scopes:
46
+ - identify,read,post,client,admin
47
+ X-Xss-Protection:
48
+ - '0'
49
+ Content-Length:
50
+ - '298'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"ok":true,"channel":{"id":"C04MY3KCY","name":"gem_testroom","is_channel":true,"created":1430871124,"creator":"U0399SL90","is_archived":false,"is_general":false,"is_member":true,"last_read":"1430871759.000005","latest":{"user":"U0399SL90","type":"message","subtype":"channel_leave","text":"<@U0399SL90|aki017>
56
+ has left the channel","ts":"1430871759.000005"},"unread_count":0,"unread_count_display":0,"members":["U0399SL90","U03LM2UM7"],"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"","creator":"","last_set":0}}}'
57
+ http_version:
58
+ recorded_at: Wed, 06 May 2015 00:22:46 GMT
59
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://slack.com/api/auth.test
6
+ body:
7
+ encoding: UTF-8
8
+ string: token=<TOKEN>
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Slack Ruby Gem 1.1.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Cache-Control:
26
+ - private, no-cache, no-store, must-revalidate
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Tue, 05 May 2015 23:44:32 GMT
31
+ Expires:
32
+ - Mon, 26 Jul 1997 05:00:00 GMT
33
+ Pragma:
34
+ - no-cache
35
+ Server:
36
+ - Apache
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains; preload
39
+ Vary:
40
+ - Accept-Encoding
41
+ X-Accepted-Oauth-Scopes:
42
+ - identify
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Oauth-Scopes:
46
+ - identify,read,post,client,admin
47
+ X-Xss-Protection:
48
+ - '0'
49
+ Content-Length:
50
+ - '123'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"ok":true,"url":"https:\/\/aki017.slack.com\/","team":"Nyan","user":"testuser","team_id":"T0399SL8W","user_id":"U03LM2UM7"}'
56
+ http_version:
57
+ recorded_at: Tue, 05 May 2015 23:44:32 GMT
58
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://slack.com/api/channels.join
6
+ body:
7
+ encoding: UTF-8
8
+ string: name=gem_testroom&token=<TOKEN>
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Slack Ruby Gem 1.1.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Cache-Control:
26
+ - private, no-cache, no-store, must-revalidate
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Tue, 05 May 2015 23:44:39 GMT
31
+ Expires:
32
+ - Mon, 26 Jul 1997 05:00:00 GMT
33
+ Pragma:
34
+ - no-cache
35
+ Server:
36
+ - Apache
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains; preload
39
+ Vary:
40
+ - Accept-Encoding
41
+ X-Accepted-Oauth-Scopes:
42
+ - post
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Oauth-Scopes:
46
+ - identify,read,post,client,admin
47
+ X-Xss-Protection:
48
+ - '0'
49
+ Content-Length:
50
+ - '199'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"ok":true,"already_in_channel":true,"channel":{"id":"C044H6VHF","name":"gem_testroom","is_channel":true,"created":1427155388,"creator":"U03LM2UM7","is_archived":false,"is_general":false,"is_member":true,"members":["U03LM2UM7"],"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"","creator":"","last_set":0}}}'
56
+ http_version:
57
+ recorded_at: Tue, 05 May 2015 23:44:39 GMT
58
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://slack.com/api/channels.kick
6
+ body:
7
+ encoding: UTF-8
8
+ string: channel=C04MY3KCY&token=<TOKEN>&user=U0399SL90
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Slack Ruby Gem 1.1.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Cache-Control:
26
+ - private, no-cache, no-store, must-revalidate
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Wed, 06 May 2015 00:24:56 GMT
31
+ Expires:
32
+ - Mon, 26 Jul 1997 05:00:00 GMT
33
+ Pragma:
34
+ - no-cache
35
+ Server:
36
+ - Apache
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains; preload
39
+ Vary:
40
+ - Accept-Encoding
41
+ X-Accepted-Oauth-Scopes:
42
+ - post
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Oauth-Scopes:
46
+ - identify,read,post,client,admin
47
+ X-Xss-Protection:
48
+ - '0'
49
+ Content-Length:
50
+ - '31'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"ok":true}'
56
+ http_version:
57
+ recorded_at: Wed, 06 May 2015 00:24:56 GMT
58
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://slack.com/api/channels.leave
6
+ body:
7
+ encoding: UTF-8
8
+ string: channel=C04NL1FKT&token=<TOKEN>
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Slack Ruby Gem 1.1.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Cache-Control:
26
+ - private, no-cache, no-store, must-revalidate
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Wed, 06 May 2015 00:27:58 GMT
31
+ Expires:
32
+ - Mon, 26 Jul 1997 05:00:00 GMT
33
+ Pragma:
34
+ - no-cache
35
+ Server:
36
+ - Apache
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains; preload
39
+ Vary:
40
+ - Accept-Encoding
41
+ X-Accepted-Oauth-Scopes:
42
+ - post
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Oauth-Scopes:
46
+ - identify,read,post,client,admin
47
+ X-Xss-Protection:
48
+ - '0'
49
+ Content-Length:
50
+ - '31'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"ok":true}'
56
+ http_version:
57
+ recorded_at: Wed, 06 May 2015 00:27:59 GMT
58
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,63 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://slack.com/api/channels.list
6
+ body:
7
+ encoding: UTF-8
8
+ string: token=<TOKEN>
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Slack Ruby Gem 1.1.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Cache-Control:
26
+ - private, no-cache, no-store, must-revalidate
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Tue, 05 May 2015 23:44:31 GMT
31
+ Expires:
32
+ - Mon, 26 Jul 1997 05:00:00 GMT
33
+ Pragma:
34
+ - no-cache
35
+ Server:
36
+ - Apache
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains; preload
39
+ Vary:
40
+ - Accept-Encoding
41
+ X-Accepted-Oauth-Scopes:
42
+ - read
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Oauth-Scopes:
46
+ - identify,read,post,client,admin
47
+ X-Xss-Protection:
48
+ - '0'
49
+ Content-Length:
50
+ - '464'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"ok":true,"channels":[{"id":"C03RJGFQS","name":"dustbox","is_channel":true,"created":1425043528,"creator":"U0399SL90","is_archived":false,"is_general":false,"is_member":false,"members":["U0399SL90"],"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"","creator":"","last_set":0},"num_members":1},{"id":"C044H6VHF","name":"gem_testroom","is_channel":true,"created":1427155388,"creator":"U03LM2UM7","is_archived":false,"is_general":false,"is_member":true,"members":["U03LM2UM7"],"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"","creator":"","last_set":0},"num_members":1},{"id":"C0399SL96","name":"general","is_channel":true,"created":1420032633,"creator":"U0399SL90","is_archived":false,"is_general":true,"is_member":true,"members":["U0399SL90","U03LM2UM7"],"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This
56
+ channel is for team-wide communication and announcements. All team members
57
+ are in this channel.","creator":"","last_set":0},"num_members":2},{"id":"C0399SL98","name":"random","is_channel":true,"created":1420032633,"creator":"U0399SL90","is_archived":false,"is_general":false,"is_member":true,"members":["U0399SL90","U03LM2UM7"],"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"A
58
+ place for non-work banter, links, articles of interest, humor or anything
59
+ else which you''d like concentrated in some place other than work-related
60
+ channels.","creator":"","last_set":0},"num_members":2}]}'
61
+ http_version:
62
+ recorded_at: Tue, 05 May 2015 23:44:31 GMT
63
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://slack.com/api/channels.mark
6
+ body:
7
+ encoding: UTF-8
8
+ string: channel=C04NL1FKT&token=<TOKEN>&ts=0
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Slack Ruby Gem 1.1.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Cache-Control:
26
+ - private, no-cache, no-store, must-revalidate
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Date:
30
+ - Wed, 06 May 2015 00:28:54 GMT
31
+ Expires:
32
+ - Mon, 26 Jul 1997 05:00:00 GMT
33
+ Pragma:
34
+ - no-cache
35
+ Server:
36
+ - Apache
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains; preload
39
+ Vary:
40
+ - Accept-Encoding
41
+ X-Accepted-Oauth-Scopes:
42
+ - post
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Oauth-Scopes:
46
+ - identify,read,post,client,admin
47
+ X-Xss-Protection:
48
+ - '0'
49
+ Content-Length:
50
+ - '31'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"ok":true}'
56
+ http_version:
57
+ recorded_at: Wed, 06 May 2015 00:28:54 GMT
58
+ recorded_with: VCR 2.9.3