From 221ac6a0d7bf943d9617332b30eca0c8899e6afe Mon Sep 17 00:00:00 2001 From: Ida Date: Tue, 6 Oct 2020 11:30:57 -0700 Subject: [PATCH 1/9] updated slack --- .idea/.gitignore | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/slack-cli.iml | 26 ++++++++++++++++++++++++++ .idea/vcs.xml | 6 ++++++ lib/slack.rb | 38 +++++++++++++++++++++++++++++++++++--- sandbox.rb | 1 + test/test_helper.rb | 2 +- 8 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/slack-cli.iml create mode 100644 .idea/vcs.xml create mode 100644 sandbox.rb diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..8bf4d45d --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,6 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..510e7fcc --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..7a98b196 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/slack-cli.iml b/.idea/slack-cli.iml new file mode 100644 index 00000000..8c3c59d5 --- /dev/null +++ b/.idea/slack-cli.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/lib/slack.rb b/lib/slack.rb index 8a0b659b..f83337a0 100755 --- a/lib/slack.rb +++ b/lib/slack.rb @@ -1,12 +1,44 @@ #!/usr/bin/env ruby +require 'dotenv' +require 'httparty' + +Dotenv.load + def main puts "Welcome to the Ada Slack CLI!" - workspace = Workspace.new + #workspace = Workspace.new # TODO project - + puts ENV['SLACK_API_TOKEN'] + response = HTTParty.get('https://slack.com/api/conversations.list', query: { + token: ENV['SLACK_API_TOKEN'] + }) + pp response puts "Thank you for using the Ada Slack CLI" end -main if __FILE__ == $PROGRAM_NAME \ No newline at end of file +main if __FILE__ == $PROGRAM_NAME + + +# require 'dotenv' +# require 'httparty' +# +# Dotenv.load +# +# def main +# puts "Welcome to the Ada Slack CLI!" +# #workspace = Workspace.new +# +# # TODO project +# puts ENV['SLACK_API_TOKEN'] +# response = HTTParty.post('https://slack.com/api/chat.postMessage', body: { +# token: ENV['SLACK_API_TOKEN'], +# channel: 'test-channel2', +# text: "my test" +# }) +# pp response +# puts "Thank you for using the Ada Slack CLI" +# end +# +# main if __FILE__ == $PROGRAM_NAME \ No newline at end of file diff --git a/sandbox.rb b/sandbox.rb new file mode 100644 index 00000000..0b9226b5 --- /dev/null +++ b/sandbox.rb @@ -0,0 +1 @@ +# require 'httparty' \ No newline at end of file diff --git a/test/test_helper.rb b/test/test_helper.rb index 1fcf2bab..e1e1a167 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,7 +8,7 @@ require 'minitest/reporters' require 'minitest/skip_dsl' require 'vcr' - +#require '../lib/slack' Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new VCR.configure do |config| From 32143c221e7988f51788348f1236270f5e8982a0 Mon Sep 17 00:00:00 2001 From: Ida Date: Tue, 6 Oct 2020 14:45:21 -0700 Subject: [PATCH 2/9] wave 1 --- .floo | 3 +++ .flooignore | 6 +++++ .gitignore | 1 + .idea/.rakeTasks | 7 ++++++ .idea/slack-cli.iml | 6 +++++ lib/slack.rb | 60 +++++++++++++++++++++++++++++++++++++++++---- lib/workspace.rb | 9 +++++++ test/test_helper.rb | 7 +++++- 8 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 .floo create mode 100644 .flooignore create mode 100644 .idea/.rakeTasks create mode 100644 lib/workspace.rb diff --git a/.floo b/.floo new file mode 100644 index 00000000..05b8e45b --- /dev/null +++ b/.floo @@ -0,0 +1,3 @@ +{ + "url": "https://floobits.com/idagoitom/slack-cli" +} \ No newline at end of file diff --git a/.flooignore b/.flooignore new file mode 100644 index 00000000..ed824d39 --- /dev/null +++ b/.flooignore @@ -0,0 +1,6 @@ +extern +node_modules +tmp +vendor +.idea/workspace.xml +.idea/misc.xml diff --git a/.gitignore b/.gitignore index 3ff4fada..83b3a339 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ # Ignore environemnt variables .env +.env diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks new file mode 100644 index 00000000..f88db1a3 --- /dev/null +++ b/.idea/.rakeTasks @@ -0,0 +1,7 @@ + + diff --git a/.idea/slack-cli.iml b/.idea/slack-cli.iml index 8c3c59d5..329312d1 100644 --- a/.idea/slack-cli.iml +++ b/.idea/slack-cli.iml @@ -13,6 +13,8 @@ + + @@ -22,5 +24,9 @@ + + + + \ No newline at end of file diff --git a/lib/slack.rb b/lib/slack.rb index f83337a0..9d3e03b8 100755 --- a/lib/slack.rb +++ b/lib/slack.rb @@ -2,20 +2,70 @@ require 'dotenv' require 'httparty' +require 'table_print' +require_relative 'workspace' Dotenv.load +USERS_URL = 'https://slack.com/api/users.list' +CHANNELS_URL = 'https://slack.com/api/conversations.list' +MESSAGE_URL = 'https://slack.com/api/chat.postMessage' + +def list_users(response) + response["members"].each do |member| + puts "Name: #{member["real_name"]}, ID: #{member["id"]} Username: #{member["display_name"]}" + end +end + +def list_channels(response) + #I should see a list of all the channels for that workspace. + # This list should include the channel's name, topic, member count, and Slack ID. + response["channels"].each do |channel| + puts "name: #{channel["name"]}, topic: #{channel["topic"]} + id: #{channel["id"]} member count: #{channel["num_members"]}" + end +end + def main puts "Welcome to the Ada Slack CLI!" - #workspace = Workspace.new + workspace = Workspace.new # TODO project - puts ENV['SLACK_API_TOKEN'] - response = HTTParty.get('https://slack.com/api/conversations.list', query: { + + channel_response = HTTParty.get(CHANNELS_URL, query: { + token: ENV['SLACK_API_TOKEN'] + }) + + user_response = HTTParty.get(USERS_URL, query: { token: ENV['SLACK_API_TOKEN'] }) - pp response - puts "Thank you for using the Ada Slack CLI" + + puts "We have #{channel_response["channels"].size} channels and #{user_response["members"].size} users loaded.\n" + + end_program = false + until end_program + puts "There are three options to interact with this program. Please pick one: " + puts "1. list users" + puts "2. list channels" + puts "3. quit\n\n" + + user_input = gets.chomp + + case user_input + when "list users" + list_users(user_response) + when "list channels" + list_channels(channel_response) + when "quit" + puts "Thank you for using the Ada Slack CLI" + end_program = true + end + end + + + + + end main if __FILE__ == $PROGRAM_NAME diff --git a/lib/workspace.rb b/lib/workspace.rb new file mode 100644 index 00000000..d0bf91ff --- /dev/null +++ b/lib/workspace.rb @@ -0,0 +1,9 @@ + +class Workspace + attr_reader :user,:channel + + def initialize + @user = [] + @channels = [] + end +end \ No newline at end of file diff --git a/test/test_helper.rb b/test/test_helper.rb index e1e1a167..8ac206d9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,6 +8,9 @@ require 'minitest/reporters' require 'minitest/skip_dsl' require 'vcr' +require "dotenv" +Dotenv.load + #require '../lib/slack' Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new @@ -25,5 +28,7 @@ } # Don't leave our token lying around in a cassette file. - + config.filter_sensitive_data("") do + ENV["LOCATIONIQ_TOKEN"] + end end From cabd6261baf2a8cd1e4428d61e63ea6cc70dc410 Mon Sep 17 00:00:00 2001 From: Ida Date: Wed, 7 Oct 2020 17:26:38 -0700 Subject: [PATCH 3/9] wave 2, testing --- .idea/slack-cli.iml | 2 +- lib/channel.rb | 26 ++++++++++++++++++ lib/recipient.rb | 27 ++++++++++++++++++ lib/slack.rb | 62 +++++++++++++----------------------------- lib/user.rb | 29 ++++++++++++++++++++ lib/workspace.rb | 52 +++++++++++++++++++++++++++++++++-- test/workspace_test.rb | 40 +++++++++++++++++++++++++++ 7 files changed, 191 insertions(+), 47 deletions(-) create mode 100644 lib/channel.rb create mode 100644 lib/recipient.rb create mode 100644 lib/user.rb create mode 100644 test/workspace_test.rb diff --git a/.idea/slack-cli.iml b/.idea/slack-cli.iml index 329312d1..e2fedfc5 100644 --- a/.idea/slack-cli.iml +++ b/.idea/slack-cli.iml @@ -18,7 +18,7 @@ - + diff --git a/lib/channel.rb b/lib/channel.rb new file mode 100644 index 00000000..4ffabb53 --- /dev/null +++ b/lib/channel.rb @@ -0,0 +1,26 @@ +require 'httparty' +require 'dotenv' +require_relative 'recipient' + +Dotenv.load + +CHANNELS_URL = 'https://slack.com/api/conversations.list' + +class Channel < Recipient + attr_reader :topic, :member_count + def initialize + @topic + @member_count + end + + def self.details + self.list_all["channels"].each do |channel| + puts "name: #{channel["name"]}, topic: #{channel["topic"]} + id: #{channel["id"]} member count: #{channel["num_members"]}" + end + end + + def self.list_all + self.get(CHANNELS_URL, PARAMS) + end +end \ No newline at end of file diff --git a/lib/recipient.rb b/lib/recipient.rb new file mode 100644 index 00000000..ad26adea --- /dev/null +++ b/lib/recipient.rb @@ -0,0 +1,27 @@ +class Recipient + PARAMS = 'SLACK_API_TOKEN' + + attr_reader :slack_id, :name + + def initialize + @slack_id = [] + @name = [] + end + + def self.get(url, params) + HTTParty.get(url, query: {token: ENV[params]}) + end + + def send_message(message) + + end + + def details + raise NotImplementedError, 'Implement me in a child class!' + end + + def self.list_all + raise NotImplementedError, 'Implement me in a child class!' + end + +end \ No newline at end of file diff --git a/lib/slack.rb b/lib/slack.rb index 9d3e03b8..260b4f9c 100755 --- a/lib/slack.rb +++ b/lib/slack.rb @@ -1,71 +1,47 @@ #!/usr/bin/env ruby -require 'dotenv' -require 'httparty' require 'table_print' - require_relative 'workspace' -Dotenv.load - -USERS_URL = 'https://slack.com/api/users.list' -CHANNELS_URL = 'https://slack.com/api/conversations.list' -MESSAGE_URL = 'https://slack.com/api/chat.postMessage' - -def list_users(response) - response["members"].each do |member| - puts "Name: #{member["real_name"]}, ID: #{member["id"]} Username: #{member["display_name"]}" - end -end - -def list_channels(response) - #I should see a list of all the channels for that workspace. - # This list should include the channel's name, topic, member count, and Slack ID. - response["channels"].each do |channel| - puts "name: #{channel["name"]}, topic: #{channel["topic"]} - id: #{channel["id"]} member count: #{channel["num_members"]}" - end -end def main puts "Welcome to the Ada Slack CLI!" - workspace = Workspace.new - # TODO project - - channel_response = HTTParty.get(CHANNELS_URL, query: { - token: ENV['SLACK_API_TOKEN'] - }) - - user_response = HTTParty.get(USERS_URL, query: { - token: ENV['SLACK_API_TOKEN'] - }) + workspace = Workspace.new - puts "We have #{channel_response["channels"].size} channels and #{user_response["members"].size} users loaded.\n" + puts "We have #{workspace.channels["channels"].size} channels and #{workspace.users["members"].size} users loaded.\n" end_program = false until end_program - puts "There are three options to interact with this program. Please pick one: " + puts "There are several options to interact with this program. Please pick one: " puts "1. list users" puts "2. list channels" - puts "3. quit\n\n" + puts "3. select user" + puts "4. select channel" + puts "5. details" + puts "6. quit\n\n" user_input = gets.chomp case user_input when "list users" - list_users(user_response) + User.details when "list channels" - list_channels(channel_response) + Channel.details + when "select user" + puts "Please enter a user name or user id:" + select_user_input = gets.chomp + workspace.select_user(select_user_input) + when "select channel" + puts "Select a channel name or id: " + channel_input = gets.chomp + workspace.select_channel(channel_input) + when "details" + workspace.show_details() when "quit" puts "Thank you for using the Ada Slack CLI" end_program = true end end - - - - - end main if __FILE__ == $PROGRAM_NAME diff --git a/lib/user.rb b/lib/user.rb new file mode 100644 index 00000000..098864f0 --- /dev/null +++ b/lib/user.rb @@ -0,0 +1,29 @@ +require 'httparty' +require 'dotenv' +require_relative 'recipient' + +Dotenv.load + +USERS_URL = 'https://slack.com/api/users.list' + +class User < Recipient + attr_reader :real_name, :status_text, :status_emoji + + def initialize + super(slack_id) + super(name) + @real_name + @status_text + @status_emoji + end + + def self.details + self.list_all["members"].each do |member| + puts "Name: #{member["real_name"]}, ID: #{member["id"]} Username: #{member["name"]}" + end + end + + def self.list_all + self.get(USERS_URL, PARAMS) + end +end \ No newline at end of file diff --git a/lib/workspace.rb b/lib/workspace.rb index d0bf91ff..4ec07829 100644 --- a/lib/workspace.rb +++ b/lib/workspace.rb @@ -1,9 +1,55 @@ +require_relative 'user' +require_relative 'channel' + +MESSAGE_URL = 'https://slack.com/api/chat.postMessage' class Workspace - attr_reader :user,:channel + attr_reader :users, :channels, :selected def initialize - @user = [] - @channels = [] + @users = User.list_all + @channels = Channel.list_all + @selected + end + + def select_user(user) + @users["members"].each do |member| + if user == member["id"] || user == member["name"] + @selected = member + end + end + + if @selected.nil? + puts "This user was not found." + end + + return @selected + end + + def select_channel(name) + @channels["channels"].each do |channel| + if name == channel["name"] || name == channel["id"] + @selected = channel + end + end + + if @selected.nil? + raise ArgumentError, "This channel was not found." + end + + return @selected + end + + def show_details + if @selected.nil? + raise ArgumentError, "No recipient is currently selected." + end + + if @selected["is_channel"] + puts "Name: #{@selected["name"]}, Topic: #{@selected["topic"]} + ID: #{@selected["id"]} Member Count: #{@selected["num_members"]}" + else + puts "Name: #{@selected["real_name"]}, ID: #{@selected["id"]} Username: #{@selected["name"]}" + end end end \ No newline at end of file diff --git a/test/workspace_test.rb b/test/workspace_test.rb new file mode 100644 index 00000000..f740eb0a --- /dev/null +++ b/test/workspace_test.rb @@ -0,0 +1,40 @@ +require_relative 'test_helper' +require_relative 'workspace' + +describe "Workspace Class" do + let "workspace instance" do + workspace = Workspace.new + end + + describe 'constructor' do + it 'is set up for specific attributes and data types' do + #workspace = Workspace.new + + [:users, :channels, :selected].each do |prop| + expect(workspace).must_respond_to prop + end + end + end + + describe 'select_user' do + it "throws an argument error with a bad ID" do + # workspace = Workspace.new + expect{ workspace.select_user('fake') }.must_raise ArgumentError + end + end + + describe 'select_channel' do + it "throws an argument error with a bad ID" do + # workspace = Workspace.new + expect{ workspace.select_channel('fake') }.must_raise ArgumentError + end + end + + describe 'details' do + it "throws an argument error with a bad ID" do + # workspace = Workspace.new + expect{ workspace.details }.must_raise ArgumentError + end + end +end + From 2a94ff786f4acc66baf02a7c64ab8a4a69df5617 Mon Sep 17 00:00:00 2001 From: Ida Date: Wed, 7 Oct 2020 18:05:44 -0700 Subject: [PATCH 4/9] updated tests with vcr --- lib/slack.rb | 2 +- lib/workspace.rb | 5 +- test/cassettes/id_error.yml | 148 +++++++++++++++++++++++++++++++++++ test/cassettes/workspace.yml | 148 +++++++++++++++++++++++++++++++++++ test/test_helper.rb | 4 +- test/workspace_test.rb | 39 ++++----- 6 files changed, 319 insertions(+), 27 deletions(-) create mode 100644 test/cassettes/id_error.yml create mode 100644 test/cassettes/workspace.yml diff --git a/lib/slack.rb b/lib/slack.rb index 260b4f9c..dfa93836 100755 --- a/lib/slack.rb +++ b/lib/slack.rb @@ -12,7 +12,7 @@ def main end_program = false until end_program - puts "There are several options to interact with this program. Please pick one: " + puts "\nThere are several options to interact with this program. Please pick one: " puts "1. list users" puts "2. list channels" puts "3. select user" diff --git a/lib/workspace.rb b/lib/workspace.rb index 4ec07829..f134d9d9 100644 --- a/lib/workspace.rb +++ b/lib/workspace.rb @@ -34,7 +34,7 @@ def select_channel(name) end if @selected.nil? - raise ArgumentError, "This channel was not found." + puts "This channel was not found." end return @selected @@ -42,7 +42,8 @@ def select_channel(name) def show_details if @selected.nil? - raise ArgumentError, "No recipient is currently selected." + puts "No recipient is currently selected." + return end if @selected["is_channel"] diff --git a/test/cassettes/id_error.yml b/test/cassettes/id_error.yml new file mode 100644 index 00000000..9b82dfb4 --- /dev/null +++ b/test/cassettes/id_error.yml @@ -0,0 +1,148 @@ +--- +http_interactions: +- request: + method: get + uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 01:03:11 GMT + Server: + - Apache + X-Slack-Req-Id: + - 981a5db6f44707a3c188563c7f9c43fc + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - users:read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '1318' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-sd3m,haproxy-edge-pdx-edcb + body: + encoding: ASCII-8BIT + string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Slackbot","real_name_normalized":"Slackbot","display_name":"Slackbot","display_name_normalized":"Slackbot","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"sv41d8cd98f0","always_active":true,"first_name":"slackbot","last_name":"","image_24":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_24.png","image_32":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_32.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_72.png","image_192":"https:\/\/a.slack-edge.com\/80588\/marketing\/img\/avatars\/slackbot\/avatar-slackbot.png","image_512":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":0},{"id":"U01BN903TU7","team_id":"T01C37A2BAP","name":"anna.kim93","deleted":false,"color":"4bbe2e","real_name":"Anna + Kim","tz":"America\/New_York","tz_label":"Eastern Daylight Time","tz_offset":-14400,"profile":{"title":"","phone":"","skype":"","real_name":"Anna + Kim","real_name_normalized":"Anna Kim","display_name":"Anna Kim","display_name_normalized":"Anna + Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 + - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 + - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire + - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602118991,"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 01:03:11 GMT +- request: + method: get + uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 01:03:11 GMT + Server: + - Apache + X-Slack-Req-Id: + - fbd9168fbcaca5c53432fba5f2c99cbd + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - channels:read,groups:read,mpim:read,im:read,read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '688' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-tgou,haproxy-edge-pdx-hw9i + body: + encoding: ASCII-8BIT + string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super + random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This + channel is for... well, everything else. It\u2019s a place for team jokes, + spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very + general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This + is the one channel that will always include everyone. It\u2019s a great spot + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + *channel* is for working on a project. Hold meetings, share docs, and make + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 01:03:12 GMT +recorded_with: VCR 6.0.0 diff --git a/test/cassettes/workspace.yml b/test/cassettes/workspace.yml new file mode 100644 index 00000000..6cdc8c4b --- /dev/null +++ b/test/cassettes/workspace.yml @@ -0,0 +1,148 @@ +--- +http_interactions: +- request: + method: get + uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 01:01:06 GMT + Server: + - Apache + X-Slack-Req-Id: + - 949a85e6b1fa9286ec71e27e14900d3a + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - users:read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '1318' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-l9vu,haproxy-edge-pdx-68eo + body: + encoding: ASCII-8BIT + string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Slackbot","real_name_normalized":"Slackbot","display_name":"Slackbot","display_name_normalized":"Slackbot","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"sv41d8cd98f0","always_active":true,"first_name":"slackbot","last_name":"","image_24":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_24.png","image_32":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_32.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_72.png","image_192":"https:\/\/a.slack-edge.com\/80588\/marketing\/img\/avatars\/slackbot\/avatar-slackbot.png","image_512":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":0},{"id":"U01BN903TU7","team_id":"T01C37A2BAP","name":"anna.kim93","deleted":false,"color":"4bbe2e","real_name":"Anna + Kim","tz":"America\/New_York","tz_label":"Eastern Daylight Time","tz_offset":-14400,"profile":{"title":"","phone":"","skype":"","real_name":"Anna + Kim","real_name_normalized":"Anna Kim","display_name":"Anna Kim","display_name_normalized":"Anna + Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 + - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 + - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire + - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602118866,"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 01:01:07 GMT +- request: + method: get + uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 01:01:07 GMT + Server: + - Apache + X-Slack-Req-Id: + - 7fefa9b550132d342fd70410ec4f93b9 + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - channels:read,groups:read,mpim:read,im:read,read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '688' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-sd3m,haproxy-edge-pdx-ed3w + body: + encoding: ASCII-8BIT + string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super + random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This + channel is for... well, everything else. It\u2019s a place for team jokes, + spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very + general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This + is the one channel that will always include everyone. It\u2019s a great spot + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + *channel* is for working on a project. Hold meetings, share docs, and make + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 01:01:07 GMT +recorded_with: VCR 6.0.0 diff --git a/test/test_helper.rb b/test/test_helper.rb index 8ac206d9..6c820fca 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -9,9 +9,11 @@ require 'minitest/skip_dsl' require 'vcr' require "dotenv" +require_relative '../lib/workspace' +require_relative '../lib/slack' + Dotenv.load -#require '../lib/slack' Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new VCR.configure do |config| diff --git a/test/workspace_test.rb b/test/workspace_test.rb index f740eb0a..1b8bdff3 100644 --- a/test/workspace_test.rb +++ b/test/workspace_test.rb @@ -1,40 +1,33 @@ require_relative 'test_helper' -require_relative 'workspace' describe "Workspace Class" do - let "workspace instance" do - workspace = Workspace.new - end + let(:workspace) { Workspace.new } describe 'constructor' do it 'is set up for specific attributes and data types' do - #workspace = Workspace.new - - [:users, :channels, :selected].each do |prop| - expect(workspace).must_respond_to prop + VCR.use_cassette("workspace") do + [:users, :channels, :selected].each do |prop| + expect(workspace).must_respond_to prop + end end end end describe 'select_user' do - it "throws an argument error with a bad ID" do - # workspace = Workspace.new - expect{ workspace.select_user('fake') }.must_raise ArgumentError - end + # it "throws an argument error with a bad ID" do + # # workspace = Workspace.new + # VCR.use_cassette("id_error") do + # expect{ workspace.select_user('fake') }.must_raise ArgumentError + # end + # end end describe 'select_channel' do - it "throws an argument error with a bad ID" do - # workspace = Workspace.new - expect{ workspace.select_channel('fake') }.must_raise ArgumentError - end - end - - describe 'details' do - it "throws an argument error with a bad ID" do - # workspace = Workspace.new - expect{ workspace.details }.must_raise ArgumentError - end + # it "throws an argument error with a bad ID" do + # VCR.use_cassette("workspace") do + # expect{ workspace.select_channel('fake') }.must_raise ArgumentError + # end + # end end end From 99d6a33199bd59bfd7d8c4626ca1c89212f23cce Mon Sep 17 00:00:00 2001 From: Ida Date: Thu, 8 Oct 2020 11:00:32 -0700 Subject: [PATCH 5/9] updated channel test, user test, workspace test --- .idea/slack-cli.iml | 2 +- lib/channel.rb | 1 + lib/recipient.rb | 4 +- lib/workspace.rb | 2 +- test/cassettes/channel.yml | 74 ++++++++++ test/cassettes/name.yml | 254 +++++++++++++++++++++++++++++++++++ test/cassettes/user.yml | 77 +++++++++++ test/cassettes/workspace.yml | 145 ++++++++++++++++++++ test/channel_test.rb | 27 ++++ test/user_test.rb | 26 ++++ test/workspace_test.rb | 23 ++-- 11 files changed, 620 insertions(+), 15 deletions(-) create mode 100644 test/cassettes/channel.yml create mode 100644 test/cassettes/name.yml create mode 100644 test/cassettes/user.yml create mode 100644 test/channel_test.rb create mode 100644 test/user_test.rb diff --git a/.idea/slack-cli.iml b/.idea/slack-cli.iml index e2fedfc5..329312d1 100644 --- a/.idea/slack-cli.iml +++ b/.idea/slack-cli.iml @@ -18,7 +18,7 @@ - + diff --git a/lib/channel.rb b/lib/channel.rb index 4ffabb53..bc350ead 100644 --- a/lib/channel.rb +++ b/lib/channel.rb @@ -8,6 +8,7 @@ class Channel < Recipient attr_reader :topic, :member_count + def initialize @topic @member_count diff --git a/lib/recipient.rb b/lib/recipient.rb index ad26adea..b93c617d 100644 --- a/lib/recipient.rb +++ b/lib/recipient.rb @@ -4,8 +4,8 @@ class Recipient attr_reader :slack_id, :name def initialize - @slack_id = [] - @name = [] + @slack_id = slack_id + @name = name end def self.get(url, params) diff --git a/lib/workspace.rb b/lib/workspace.rb index f134d9d9..01907eff 100644 --- a/lib/workspace.rb +++ b/lib/workspace.rb @@ -9,7 +9,7 @@ class Workspace def initialize @users = User.list_all @channels = Channel.list_all - @selected + @selected = nil end def select_user(user) diff --git a/test/cassettes/channel.yml b/test/cassettes/channel.yml new file mode 100644 index 00000000..d5a37c2c --- /dev/null +++ b/test/cassettes/channel.yml @@ -0,0 +1,74 @@ +--- +http_interactions: +- request: + method: get + uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 17:58:24 GMT + Server: + - Apache + X-Slack-Req-Id: + - cc14b69fa2f388fb9383af163264e4db + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - channels:read,groups:read,mpim:read,im:read,read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '688' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-goq2,haproxy-edge-iad-ltbr + body: + encoding: ASCII-8BIT + string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super + random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This + channel is for... well, everything else. It\u2019s a place for team jokes, + spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very + general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This + is the one channel that will always include everyone. It\u2019s a great spot + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + *channel* is for working on a project. Hold meetings, share docs, and make + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 17:58:24 GMT +recorded_with: VCR 6.0.0 diff --git a/test/cassettes/name.yml b/test/cassettes/name.yml new file mode 100644 index 00000000..b71ef562 --- /dev/null +++ b/test/cassettes/name.yml @@ -0,0 +1,254 @@ +--- +http_interactions: +- request: + method: get + uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 17:28:07 GMT + Server: + - Apache + X-Slack-Req-Id: + - da0f83d57a2c7fef889a9bfb720265a0 + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + X-Slack-Backend: + - r + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Content-Length: + - '54' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-28oy,haproxy-edge-pdx-jxbh + body: + encoding: ASCII-8BIT + string: '{"ok":false,"error":"token_revoked"}' + recorded_at: Thu, 08 Oct 2020 17:28:07 GMT +- request: + method: get + uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 17:28:07 GMT + Server: + - Apache + X-Slack-Req-Id: + - 587268a6a50be1252e99d1b59271f501 + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + X-Slack-Backend: + - r + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Content-Length: + - '54' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-ce55,haproxy-edge-pdx-4ut7 + body: + encoding: ASCII-8BIT + string: '{"ok":false,"error":"token_revoked"}' + recorded_at: Thu, 08 Oct 2020 17:28:07 GMT +- request: + method: get + uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 17:28:43 GMT + Server: + - Apache + X-Slack-Req-Id: + - 35ef1748e8effeb8842e28a851e67cb9 + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - users:read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '1315' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-y70x,haproxy-edge-iad-zb7s + body: + encoding: ASCII-8BIT + string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Slackbot","real_name_normalized":"Slackbot","display_name":"Slackbot","display_name_normalized":"Slackbot","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"sv41d8cd98f0","always_active":true,"first_name":"slackbot","last_name":"","image_24":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_24.png","image_32":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_32.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_72.png","image_192":"https:\/\/a.slack-edge.com\/80588\/marketing\/img\/avatars\/slackbot\/avatar-slackbot.png","image_512":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":0},{"id":"U01BN903TU7","team_id":"T01C37A2BAP","name":"anna.kim93","deleted":false,"color":"4bbe2e","real_name":"Anna + Kim","tz":"America\/New_York","tz_label":"Eastern Daylight Time","tz_offset":-14400,"profile":{"title":"","phone":"","skype":"","real_name":"Anna + Kim","real_name_normalized":"Anna Kim","display_name":"Anna Kim","display_name_normalized":"Anna + Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 + - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 + - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire + - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602178123,"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 17:28:43 GMT +- request: + method: get + uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 17:28:43 GMT + Server: + - Apache + X-Slack-Req-Id: + - 2c0cb341cd2b0d98658e2d0c3128a277 + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - channels:read,groups:read,mpim:read,im:read,read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '688' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-hd00,haproxy-edge-iad-vvaf + body: + encoding: ASCII-8BIT + string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super + random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This + channel is for... well, everything else. It\u2019s a place for team jokes, + spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very + general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This + is the one channel that will always include everyone. It\u2019s a great spot + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + *channel* is for working on a project. Hold meetings, share docs, and make + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 17:28:43 GMT +recorded_with: VCR 6.0.0 diff --git a/test/cassettes/user.yml b/test/cassettes/user.yml new file mode 100644 index 00000000..7131dc3c --- /dev/null +++ b/test/cassettes/user.yml @@ -0,0 +1,77 @@ +--- +http_interactions: +- request: + method: get + uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 17:53:14 GMT + Server: + - Apache + X-Slack-Req-Id: + - befbd23211f937c25666cf3dc82a15c7 + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - users:read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '1315' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-cyj4,haproxy-edge-iad-94hh + body: + encoding: ASCII-8BIT + string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Slackbot","real_name_normalized":"Slackbot","display_name":"Slackbot","display_name_normalized":"Slackbot","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"sv41d8cd98f0","always_active":true,"first_name":"slackbot","last_name":"","image_24":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_24.png","image_32":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_32.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_72.png","image_192":"https:\/\/a.slack-edge.com\/80588\/marketing\/img\/avatars\/slackbot\/avatar-slackbot.png","image_512":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":0},{"id":"U01BN903TU7","team_id":"T01C37A2BAP","name":"anna.kim93","deleted":false,"color":"4bbe2e","real_name":"Anna + Kim","tz":"America\/New_York","tz_label":"Eastern Daylight Time","tz_offset":-14400,"profile":{"title":"","phone":"","skype":"","real_name":"Anna + Kim","real_name_normalized":"Anna Kim","display_name":"Anna Kim","display_name_normalized":"Anna + Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 + - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 + - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire + - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602179594,"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 17:53:14 GMT +recorded_with: VCR 6.0.0 diff --git a/test/cassettes/workspace.yml b/test/cassettes/workspace.yml index 6cdc8c4b..6486dc38 100644 --- a/test/cassettes/workspace.yml +++ b/test/cassettes/workspace.yml @@ -145,4 +145,149 @@ http_interactions: *channel* is for working on a project. Hold meetings, share docs, and make decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' recorded_at: Thu, 08 Oct 2020 01:01:07 GMT +- request: + method: get + uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 17:28:43 GMT + Server: + - Apache + X-Slack-Req-Id: + - 720274f09f3fadcc2d852e3dfeb80b39 + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - users:read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '1315' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-pqd0,haproxy-edge-iad-y9g6 + body: + encoding: ASCII-8BIT + string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Slackbot","real_name_normalized":"Slackbot","display_name":"Slackbot","display_name_normalized":"Slackbot","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"sv41d8cd98f0","always_active":true,"first_name":"slackbot","last_name":"","image_24":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_24.png","image_32":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_32.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_72.png","image_192":"https:\/\/a.slack-edge.com\/80588\/marketing\/img\/avatars\/slackbot\/avatar-slackbot.png","image_512":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":0},{"id":"U01BN903TU7","team_id":"T01C37A2BAP","name":"anna.kim93","deleted":false,"color":"4bbe2e","real_name":"Anna + Kim","tz":"America\/New_York","tz_label":"Eastern Daylight Time","tz_offset":-14400,"profile":{"title":"","phone":"","skype":"","real_name":"Anna + Kim","real_name_normalized":"Anna Kim","display_name":"Anna Kim","display_name_normalized":"Anna + Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 + - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 + - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight + Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire + - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602178123,"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 17:28:43 GMT +- request: + method: get + uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 17:28:43 GMT + Server: + - Apache + X-Slack-Req-Id: + - b687edd647aca871fa9902099847bf11 + X-Oauth-Scopes: + - identify,channels:read,users:read,chat:write + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - channels:read,groups:read,mpim:read,im:read,read + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '688' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-a9vn,haproxy-edge-iad-jze3 + body: + encoding: ASCII-8BIT + string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super + random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This + channel is for... well, everything else. It\u2019s a place for team jokes, + spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very + general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This + is the one channel that will always include everyone. It\u2019s a great spot + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + *channel* is for working on a project. Hold meetings, share docs, and make + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 17:28:43 GMT recorded_with: VCR 6.0.0 diff --git a/test/channel_test.rb b/test/channel_test.rb new file mode 100644 index 00000000..a4958fc6 --- /dev/null +++ b/test/channel_test.rb @@ -0,0 +1,27 @@ +require_relative 'test_helper' + +describe "Channel class" do + # let(:user) { User.new } + + describe "list_all" do + it "get channels" do + VCR.use_cassette("channel") do + response = Channel.list_all + + expect(response["channels"][0]["name"]).wont_be_nil + expect(response["channels"][0]["name"]).must_equal "random" + expect(response["channels"][0]["id"]).must_equal "C01BW93UN8N" + expect(response["channels"][0]["num_members"]).must_equal 2 + end + end + + # it "will raise an exception if the search fails" do + # VCR.use_cassette("location_find") do + # location = "" + # expect { + # response = get_location(location) + # }.must_raise SearchError + # end + # end + end +end \ No newline at end of file diff --git a/test/user_test.rb b/test/user_test.rb new file mode 100644 index 00000000..06d7fe38 --- /dev/null +++ b/test/user_test.rb @@ -0,0 +1,26 @@ +require_relative 'test_helper' + +describe "User class" do + let(:user) { User.new } + + describe "list_all" do + it "get users" do + VCR.use_cassette("user") do + response = User.list_all + + expect(response["members"][0]["name"]).wont_be_nil + expect(response["members"][0]["name"]).must_equal "slackbot" + expect(response["members"][0]["real_name"]).must_equal "Slackbot" + end + end + + # it "will raise an exception if the search fails" do + # VCR.use_cassette("location_find") do + # location = "" + # expect { + # response = get_location(location) + # }.must_raise SearchError + # end + # end + end +end \ No newline at end of file diff --git a/test/workspace_test.rb b/test/workspace_test.rb index 1b8bdff3..251b0bf7 100644 --- a/test/workspace_test.rb +++ b/test/workspace_test.rb @@ -14,20 +14,21 @@ end describe 'select_user' do - # it "throws an argument error with a bad ID" do - # # workspace = Workspace.new - # VCR.use_cassette("id_error") do - # expect{ workspace.select_user('fake') }.must_raise ArgumentError - # end - # end + it "selects the user" do + VCR.use_cassette("name") do + workspace.select_user("ida.goitom") + expect(workspace.selected["name"]).must_equal "ida.goitom" + end + end end describe 'select_channel' do - # it "throws an argument error with a bad ID" do - # VCR.use_cassette("workspace") do - # expect{ workspace.select_channel('fake') }.must_raise ArgumentError - # end - # end + it "selects the right channel when provided name or ID" do + VCR.use_cassette("workspace") do + workspace.select_channel("random") + expect(workspace.selected["name"]).must_equal "random" + end + end end end From ae129929317cc9e85543584cd830396819031695 Mon Sep 17 00:00:00 2001 From: Ida Date: Thu, 8 Oct 2020 14:55:35 -0700 Subject: [PATCH 6/9] wave 3 and added details test --- .gitignore | 3 +- .idea/slack-cli.iml | 2 +- lib/channel.rb | 30 ++--- lib/recipient.rb | 29 +++- lib/slack.rb | 36 ++--- lib/user.rb | 35 +++-- lib/workspace.rb | 27 ++-- test/cassettes/channel.yml | 144 +++++++++++++++++++- test/cassettes/id_error.yml | 148 -------------------- test/cassettes/name.yml | 254 ----------------------------------- test/cassettes/user.yml | 12 +- test/cassettes/workspace.yml | 171 ++--------------------- test/channel_test.rb | 34 +++-- test/test_helper.rb | 5 +- test/user_test.rb | 7 +- test/workspace_test.rb | 16 ++- 16 files changed, 283 insertions(+), 670 deletions(-) delete mode 100644 test/cassettes/id_error.yml delete mode 100644 test/cassettes/name.yml diff --git a/.gitignore b/.gitignore index 83b3a339..e651d86e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ # Ignore environemnt variables .env -.env +.floo +.flooignore diff --git a/.idea/slack-cli.iml b/.idea/slack-cli.iml index 329312d1..e2fedfc5 100644 --- a/.idea/slack-cli.iml +++ b/.idea/slack-cli.iml @@ -18,7 +18,7 @@ - + diff --git a/lib/channel.rb b/lib/channel.rb index bc350ead..5c8b1f25 100644 --- a/lib/channel.rb +++ b/lib/channel.rb @@ -1,27 +1,27 @@ -require 'httparty' -require 'dotenv' require_relative 'recipient' -Dotenv.load - -CHANNELS_URL = 'https://slack.com/api/conversations.list' - class Channel < Recipient attr_reader :topic, :member_count - def initialize - @topic - @member_count + def initialize(slack_id:, name:, topic:, member_count:) + super(slack_id: slack_id, name: name) + @topic = topic + @member_count = member_count end - def self.details - self.list_all["channels"].each do |channel| - puts "name: #{channel["name"]}, topic: #{channel["topic"]} - id: #{channel["id"]} member count: #{channel["num_members"]}" - end + def details + return "Name: #{@name}, ID: #{@slack_id}, Topic: #{@topic}, Member count: #{@member_count}" end def self.list_all - self.get(CHANNELS_URL, PARAMS) + response = self.get(CHANNELS_URL, PARAMS) + response["channels"].map do |channel| + Channel.new( + slack_id: channel["id"], + name: channel["name"], + topic: channel["topic"]["value"], + member_count: channel["num_members"] + ) + end end end \ No newline at end of file diff --git a/lib/recipient.rb b/lib/recipient.rb index b93c617d..ca7abbe5 100644 --- a/lib/recipient.rb +++ b/lib/recipient.rb @@ -1,18 +1,45 @@ +require 'httparty' +require 'dotenv' + +Dotenv.load + +class SlackApiError < StandardError; end + class Recipient + USERS_URL = 'https://slack.com/api/users.list' + CHANNELS_URL = 'https://slack.com/api/conversations.list' + MESSAGE_URL = 'https://slack.com/api/chat.postMessage' PARAMS = 'SLACK_API_TOKEN' + SLACK_BOT_TOKEN = 'SLACK_BOT_API_TOKEN' attr_reader :slack_id, :name - def initialize + def initialize(slack_id: nil, name: nil) @slack_id = slack_id @name = name end def self.get(url, params) + sleep(0.5) HTTParty.get(url, query: {token: ENV[params]}) end def send_message(message) + sleep(0.5) + + response = HTTParty.post( + MESSAGE_URL, + body: { + token: ENV[SLACK_BOT_TOKEN], + channel: @slack_id, + text: message + }, + headers: { 'Content-Type' => 'application/x-www-form-urlencoded' } + ) + + unless response.code == 200 && response.parsed_response["ok"] + raise SlackApiError, "Error when posting #{message} to #{@slack_id}, error: #{response.parsed_response["error"]}" + end end diff --git a/lib/slack.rb b/lib/slack.rb index dfa93836..d06efdba 100755 --- a/lib/slack.rb +++ b/lib/slack.rb @@ -8,7 +8,7 @@ def main workspace = Workspace.new - puts "We have #{workspace.channels["channels"].size} channels and #{workspace.users["members"].size} users loaded.\n" + puts "We have #{workspace.channels.size} channels and #{workspace.users.size} users loaded.\n" end_program = false until end_program @@ -18,25 +18,28 @@ def main puts "3. select user" puts "4. select channel" puts "5. details" - puts "6. quit\n\n" + puts "6. send message" + puts "7. quit\n\n" user_input = gets.chomp case user_input when "list users" - User.details + tp User.list_all, "real_name", "slack_id", "name" when "list channels" - Channel.details + tp Channel.list_all, "name", "topic", "slack_id", "member_count" when "select user" puts "Please enter a user name or user id:" select_user_input = gets.chomp workspace.select_user(select_user_input) when "select channel" - puts "Select a channel name or id: " + puts "Select a channel name or id:" channel_input = gets.chomp workspace.select_channel(channel_input) when "details" - workspace.show_details() + puts workspace.show_details + when "send message" + workspace.send_message when "quit" puts "Thank you for using the Ada Slack CLI" end_program = true @@ -47,24 +50,3 @@ def main main if __FILE__ == $PROGRAM_NAME -# require 'dotenv' -# require 'httparty' -# -# Dotenv.load -# -# def main -# puts "Welcome to the Ada Slack CLI!" -# #workspace = Workspace.new -# -# # TODO project -# puts ENV['SLACK_API_TOKEN'] -# response = HTTParty.post('https://slack.com/api/chat.postMessage', body: { -# token: ENV['SLACK_API_TOKEN'], -# channel: 'test-channel2', -# text: "my test" -# }) -# pp response -# puts "Thank you for using the Ada Slack CLI" -# end -# -# main if __FILE__ == $PROGRAM_NAME \ No newline at end of file diff --git a/lib/user.rb b/lib/user.rb index 098864f0..73892a5f 100644 --- a/lib/user.rb +++ b/lib/user.rb @@ -1,29 +1,28 @@ -require 'httparty' -require 'dotenv' require_relative 'recipient' -Dotenv.load - -USERS_URL = 'https://slack.com/api/users.list' - class User < Recipient - attr_reader :real_name, :status_text, :status_emoji + attr_reader :real_name - def initialize - super(slack_id) - super(name) - @real_name - @status_text - @status_emoji + def initialize(slack_id:, name:, real_name:) + super(slack_id: slack_id, name: name) + @real_name = real_name + # @status_text + # @status_emoji end - def self.details - self.list_all["members"].each do |member| - puts "Name: #{member["real_name"]}, ID: #{member["id"]} Username: #{member["name"]}" - end + def details + return "Name: #{@real_name}, ID: #{@slack_id}, Username: #{@name}" end def self.list_all - self.get(USERS_URL, PARAMS) + response = self.get(USERS_URL, PARAMS) + + response["members"].map do |member| + User.new( + slack_id: member["id"], + name: member["name"], + real_name: member["real_name"] + ) + end end end \ No newline at end of file diff --git a/lib/workspace.rb b/lib/workspace.rb index 01907eff..8803729a 100644 --- a/lib/workspace.rb +++ b/lib/workspace.rb @@ -1,8 +1,6 @@ require_relative 'user' require_relative 'channel' -MESSAGE_URL = 'https://slack.com/api/chat.postMessage' - class Workspace attr_reader :users, :channels, :selected @@ -13,8 +11,8 @@ def initialize end def select_user(user) - @users["members"].each do |member| - if user == member["id"] || user == member["name"] + @users.each do |member| + if user == member.slack_id || user == member.name @selected = member end end @@ -27,8 +25,8 @@ def select_user(user) end def select_channel(name) - @channels["channels"].each do |channel| - if name == channel["name"] || name == channel["id"] + @channels.each do |channel| + if name == channel.name || name == channel.slack_id @selected = channel end end @@ -46,11 +44,18 @@ def show_details return end - if @selected["is_channel"] - puts "Name: #{@selected["name"]}, Topic: #{@selected["topic"]} - ID: #{@selected["id"]} Member Count: #{@selected["num_members"]}" - else - puts "Name: #{@selected["real_name"]}, ID: #{@selected["id"]} Username: #{@selected["name"]}" + @selected.details + end + + def send_message + if @selected.nil? + puts "No recipient is currently selected to send a message to." + return end + + puts "Please enter a message:" + message = gets.chomp + + @selected.send_message(message) end end \ No newline at end of file diff --git a/test/cassettes/channel.yml b/test/cassettes/channel.yml index d5a37c2c..a9feaff0 100644 --- a/test/cassettes/channel.yml +++ b/test/cassettes/channel.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + uri: https://slack.com/api/conversations.list?token= body: encoding: US-ASCII string: '' @@ -19,11 +19,11 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 17:58:24 GMT + - Thu, 08 Oct 2020 21:24:45 GMT Server: - Apache X-Slack-Req-Id: - - cc14b69fa2f388fb9383af163264e4db + - 69d06e9f6e6b5f0b8c43ef166cea2956 X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -54,21 +54,151 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '688' + - '692' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-goq2,haproxy-edge-iad-ltbr + - haproxy-www-yo7l,haproxy-edge-iad-bbo4 body: encoding: ASCII-8BIT string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This channel is for... well, everything else. It\u2019s a place for team jokes, - spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very + spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":4},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This is the one channel that will always include everyone. It\u2019s a great spot for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This *channel* is for working on a project. Hold meetings, share docs, and make decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 17:58:24 GMT + recorded_at: Thu, 08 Oct 2020 21:24:45 GMT +- request: + method: post + uri: https://slack.com/api/chat.postMessage + body: + encoding: UTF-8 + string: token=xoxb-1411248079363-1404340511606-j0fNU7www00xC96MLNvW9LiQ&channel=fake&text=This%20post%20should%20not%20work + headers: + Content-Type: + - application/x-www-form-urlencoded + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 21:48:43 GMT + Server: + - Apache + X-Slack-Req-Id: + - 68b4338d0614013933751b1195290491 + X-Oauth-Scopes: + - chat:write,users:read,channels:read + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - chat:write + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '60' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-dqm5,haproxy-edge-pdx-1x0h + body: + encoding: ASCII-8BIT + string: '{"ok":false,"error":"channel_not_found"}' + recorded_at: Thu, 08 Oct 2020 21:48:43 GMT +- request: + method: post + uri: https://slack.com/api/chat.postMessage + body: + encoding: UTF-8 + string: token=xoxb-1411248079363-1411069541026-h2T6zZv2KCGYwTwRUEfsYZsp&channel=fake&text=This%20post%20should%20not%20work + headers: + Content-Type: + - application/x-www-form-urlencoded + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 08 Oct 2020 21:55:10 GMT + Server: + - Apache + X-Slack-Req-Id: + - e0cd0634a1b909be8d0f2b00ab4abc14 + X-Oauth-Scopes: + - chat:write,channels:read,users:read + Access-Control-Expose-Headers: + - x-slack-req-id, retry-after + Access-Control-Allow-Origin: + - "*" + X-Slack-Backend: + - r + X-Content-Type-Options: + - nosniff + Expires: + - Mon, 26 Jul 1997 05:00:00 GMT + Cache-Control: + - private, no-cache, no-store, must-revalidate + X-Xss-Protection: + - '0' + X-Accepted-Oauth-Scopes: + - chat:write + Access-Control-Allow-Headers: + - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, + x-b3-sampled, x-b3-flags + Vary: + - Accept-Encoding + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Referrer-Policy: + - no-referrer + Content-Length: + - '60' + Content-Type: + - application/json; charset=utf-8 + X-Via: + - haproxy-www-m88x,haproxy-edge-iad-kz0s + body: + encoding: ASCII-8BIT + string: '{"ok":false,"error":"channel_not_found"}' + recorded_at: Thu, 08 Oct 2020 21:55:10 GMT recorded_with: VCR 6.0.0 diff --git a/test/cassettes/id_error.yml b/test/cassettes/id_error.yml deleted file mode 100644 index 9b82dfb4..00000000 --- a/test/cassettes/id_error.yml +++ /dev/null @@ -1,148 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 08 Oct 2020 01:03:11 GMT - Server: - - Apache - X-Slack-Req-Id: - - 981a5db6f44707a3c188563c7f9c43fc - X-Oauth-Scopes: - - identify,channels:read,users:read,chat:write - Access-Control-Expose-Headers: - - x-slack-req-id, retry-after - Access-Control-Allow-Origin: - - "*" - X-Slack-Backend: - - r - X-Content-Type-Options: - - nosniff - Expires: - - Mon, 26 Jul 1997 05:00:00 GMT - Cache-Control: - - private, no-cache, no-store, must-revalidate - X-Xss-Protection: - - '0' - X-Accepted-Oauth-Scopes: - - users:read - Access-Control-Allow-Headers: - - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, - x-b3-sampled, x-b3-flags - Vary: - - Accept-Encoding - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - Referrer-Policy: - - no-referrer - Content-Length: - - '1318' - Content-Type: - - application/json; charset=utf-8 - X-Via: - - haproxy-www-sd3m,haproxy-edge-pdx-edcb - body: - encoding: ASCII-8BIT - string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Slackbot","real_name_normalized":"Slackbot","display_name":"Slackbot","display_name_normalized":"Slackbot","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"sv41d8cd98f0","always_active":true,"first_name":"slackbot","last_name":"","image_24":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_24.png","image_32":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_32.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_72.png","image_192":"https:\/\/a.slack-edge.com\/80588\/marketing\/img\/avatars\/slackbot\/avatar-slackbot.png","image_512":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":0},{"id":"U01BN903TU7","team_id":"T01C37A2BAP","name":"anna.kim93","deleted":false,"color":"4bbe2e","real_name":"Anna - Kim","tz":"America\/New_York","tz_label":"Eastern Daylight Time","tz_offset":-14400,"profile":{"title":"","phone":"","skype":"","real_name":"Anna - Kim","real_name_normalized":"Anna Kim","display_name":"Anna Kim","display_name_normalized":"Anna - Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 - - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight - Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 - - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire - - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight - Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602118991,"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 01:03:11 GMT -- request: - method: get - uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 08 Oct 2020 01:03:11 GMT - Server: - - Apache - X-Slack-Req-Id: - - fbd9168fbcaca5c53432fba5f2c99cbd - X-Oauth-Scopes: - - identify,channels:read,users:read,chat:write - Access-Control-Expose-Headers: - - x-slack-req-id, retry-after - Access-Control-Allow-Origin: - - "*" - X-Slack-Backend: - - r - X-Content-Type-Options: - - nosniff - Expires: - - Mon, 26 Jul 1997 05:00:00 GMT - Cache-Control: - - private, no-cache, no-store, must-revalidate - X-Xss-Protection: - - '0' - X-Accepted-Oauth-Scopes: - - channels:read,groups:read,mpim:read,im:read,read - Access-Control-Allow-Headers: - - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, - x-b3-sampled, x-b3-flags - Vary: - - Accept-Encoding - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - Referrer-Policy: - - no-referrer - Content-Length: - - '688' - Content-Type: - - application/json; charset=utf-8 - X-Via: - - haproxy-www-tgou,haproxy-edge-pdx-hw9i - body: - encoding: ASCII-8BIT - string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super - random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This - channel is for... well, everything else. It\u2019s a place for team jokes, - spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very - general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This - is the one channel that will always include everyone. It\u2019s a great spot - for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This - *channel* is for working on a project. Hold meetings, share docs, and make - decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 01:03:12 GMT -recorded_with: VCR 6.0.0 diff --git a/test/cassettes/name.yml b/test/cassettes/name.yml deleted file mode 100644 index b71ef562..00000000 --- a/test/cassettes/name.yml +++ /dev/null @@ -1,254 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 08 Oct 2020 17:28:07 GMT - Server: - - Apache - X-Slack-Req-Id: - - da0f83d57a2c7fef889a9bfb720265a0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - Access-Control-Allow-Headers: - - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, - x-b3-sampled, x-b3-flags - Vary: - - Accept-Encoding - X-Slack-Backend: - - r - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - x-slack-req-id, retry-after - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - '0' - Content-Length: - - '54' - Content-Type: - - application/json; charset=utf-8 - X-Via: - - haproxy-www-28oy,haproxy-edge-pdx-jxbh - body: - encoding: ASCII-8BIT - string: '{"ok":false,"error":"token_revoked"}' - recorded_at: Thu, 08 Oct 2020 17:28:07 GMT -- request: - method: get - uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 08 Oct 2020 17:28:07 GMT - Server: - - Apache - X-Slack-Req-Id: - - 587268a6a50be1252e99d1b59271f501 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - Access-Control-Allow-Headers: - - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, - x-b3-sampled, x-b3-flags - Vary: - - Accept-Encoding - X-Slack-Backend: - - r - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - x-slack-req-id, retry-after - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - '0' - Content-Length: - - '54' - Content-Type: - - application/json; charset=utf-8 - X-Via: - - haproxy-www-ce55,haproxy-edge-pdx-4ut7 - body: - encoding: ASCII-8BIT - string: '{"ok":false,"error":"token_revoked"}' - recorded_at: Thu, 08 Oct 2020 17:28:07 GMT -- request: - method: get - uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 08 Oct 2020 17:28:43 GMT - Server: - - Apache - X-Slack-Req-Id: - - 35ef1748e8effeb8842e28a851e67cb9 - X-Oauth-Scopes: - - identify,channels:read,users:read,chat:write - Access-Control-Expose-Headers: - - x-slack-req-id, retry-after - Access-Control-Allow-Origin: - - "*" - X-Slack-Backend: - - r - X-Content-Type-Options: - - nosniff - Expires: - - Mon, 26 Jul 1997 05:00:00 GMT - Cache-Control: - - private, no-cache, no-store, must-revalidate - X-Xss-Protection: - - '0' - X-Accepted-Oauth-Scopes: - - users:read - Access-Control-Allow-Headers: - - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, - x-b3-sampled, x-b3-flags - Vary: - - Accept-Encoding - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - Referrer-Policy: - - no-referrer - Content-Length: - - '1315' - Content-Type: - - application/json; charset=utf-8 - X-Via: - - haproxy-www-y70x,haproxy-edge-iad-zb7s - body: - encoding: ASCII-8BIT - string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Slackbot","real_name_normalized":"Slackbot","display_name":"Slackbot","display_name_normalized":"Slackbot","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"sv41d8cd98f0","always_active":true,"first_name":"slackbot","last_name":"","image_24":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_24.png","image_32":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_32.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_72.png","image_192":"https:\/\/a.slack-edge.com\/80588\/marketing\/img\/avatars\/slackbot\/avatar-slackbot.png","image_512":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":0},{"id":"U01BN903TU7","team_id":"T01C37A2BAP","name":"anna.kim93","deleted":false,"color":"4bbe2e","real_name":"Anna - Kim","tz":"America\/New_York","tz_label":"Eastern Daylight Time","tz_offset":-14400,"profile":{"title":"","phone":"","skype":"","real_name":"Anna - Kim","real_name_normalized":"Anna Kim","display_name":"Anna Kim","display_name_normalized":"Anna - Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 - - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight - Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 - - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire - - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight - Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602178123,"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 17:28:43 GMT -- request: - method: get - uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 08 Oct 2020 17:28:43 GMT - Server: - - Apache - X-Slack-Req-Id: - - 2c0cb341cd2b0d98658e2d0c3128a277 - X-Oauth-Scopes: - - identify,channels:read,users:read,chat:write - Access-Control-Expose-Headers: - - x-slack-req-id, retry-after - Access-Control-Allow-Origin: - - "*" - X-Slack-Backend: - - r - X-Content-Type-Options: - - nosniff - Expires: - - Mon, 26 Jul 1997 05:00:00 GMT - Cache-Control: - - private, no-cache, no-store, must-revalidate - X-Xss-Protection: - - '0' - X-Accepted-Oauth-Scopes: - - channels:read,groups:read,mpim:read,im:read,read - Access-Control-Allow-Headers: - - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, - x-b3-sampled, x-b3-flags - Vary: - - Accept-Encoding - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - Referrer-Policy: - - no-referrer - Content-Length: - - '688' - Content-Type: - - application/json; charset=utf-8 - X-Via: - - haproxy-www-hd00,haproxy-edge-iad-vvaf - body: - encoding: ASCII-8BIT - string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super - random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This - channel is for... well, everything else. It\u2019s a place for team jokes, - spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very - general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This - is the one channel that will always include everyone. It\u2019s a great spot - for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This - *channel* is for working on a project. Hold meetings, share docs, and make - decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 17:28:43 GMT -recorded_with: VCR 6.0.0 diff --git a/test/cassettes/user.yml b/test/cassettes/user.yml index 7131dc3c..c2729599 100644 --- a/test/cassettes/user.yml +++ b/test/cassettes/user.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + uri: https://slack.com/api/users.list?token= body: encoding: US-ASCII string: '' @@ -19,11 +19,11 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 17:53:14 GMT + - Thu, 08 Oct 2020 21:24:44 GMT Server: - Apache X-Slack-Req-Id: - - befbd23211f937c25666cf3dc82a15c7 + - a7ca9503e0f8f09e2ea373def13091e1 X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -58,7 +58,7 @@ http_interactions: Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-cyj4,haproxy-edge-iad-94hh + - haproxy-www-008d,haproxy-edge-iad-tl66 body: encoding: ASCII-8BIT string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific @@ -72,6 +72,6 @@ http_interactions: - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602179594,"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 17:53:14 GMT + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602192284,"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 21:24:44 GMT recorded_with: VCR 6.0.0 diff --git a/test/cassettes/workspace.yml b/test/cassettes/workspace.yml index 6486dc38..45b9b67b 100644 --- a/test/cassettes/workspace.yml +++ b/test/cassettes/workspace.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 + uri: https://slack.com/api/users.list?token= body: encoding: US-ASCII string: '' @@ -19,156 +19,11 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 01:01:06 GMT + - Thu, 08 Oct 2020 21:24:41 GMT Server: - Apache X-Slack-Req-Id: - - 949a85e6b1fa9286ec71e27e14900d3a - X-Oauth-Scopes: - - identify,channels:read,users:read,chat:write - Access-Control-Expose-Headers: - - x-slack-req-id, retry-after - Access-Control-Allow-Origin: - - "*" - X-Slack-Backend: - - r - X-Content-Type-Options: - - nosniff - Expires: - - Mon, 26 Jul 1997 05:00:00 GMT - Cache-Control: - - private, no-cache, no-store, must-revalidate - X-Xss-Protection: - - '0' - X-Accepted-Oauth-Scopes: - - users:read - Access-Control-Allow-Headers: - - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, - x-b3-sampled, x-b3-flags - Vary: - - Accept-Encoding - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - Referrer-Policy: - - no-referrer - Content-Length: - - '1318' - Content-Type: - - application/json; charset=utf-8 - X-Via: - - haproxy-www-l9vu,haproxy-edge-pdx-68eo - body: - encoding: ASCII-8BIT - string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Slackbot","real_name_normalized":"Slackbot","display_name":"Slackbot","display_name_normalized":"Slackbot","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"sv41d8cd98f0","always_active":true,"first_name":"slackbot","last_name":"","image_24":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_24.png","image_32":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_32.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_72.png","image_192":"https:\/\/a.slack-edge.com\/80588\/marketing\/img\/avatars\/slackbot\/avatar-slackbot.png","image_512":"https:\/\/a.slack-edge.com\/80588\/img\/slackbot_512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":0},{"id":"U01BN903TU7","team_id":"T01C37A2BAP","name":"anna.kim93","deleted":false,"color":"4bbe2e","real_name":"Anna - Kim","tz":"America\/New_York","tz_label":"Eastern Daylight Time","tz_offset":-14400,"profile":{"title":"","phone":"","skype":"","real_name":"Anna - Kim","real_name_normalized":"Anna Kim","display_name":"Anna Kim","display_name_normalized":"Anna - Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 - - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight - Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 - - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire - - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight - Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602118866,"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 01:01:07 GMT -- request: - method: get - uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1417202195972-1407982375205-f53f46ae392c39c4348d6135bbf0e7c4 - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 08 Oct 2020 01:01:07 GMT - Server: - - Apache - X-Slack-Req-Id: - - 7fefa9b550132d342fd70410ec4f93b9 - X-Oauth-Scopes: - - identify,channels:read,users:read,chat:write - Access-Control-Expose-Headers: - - x-slack-req-id, retry-after - Access-Control-Allow-Origin: - - "*" - X-Slack-Backend: - - r - X-Content-Type-Options: - - nosniff - Expires: - - Mon, 26 Jul 1997 05:00:00 GMT - Cache-Control: - - private, no-cache, no-store, must-revalidate - X-Xss-Protection: - - '0' - X-Accepted-Oauth-Scopes: - - channels:read,groups:read,mpim:read,im:read,read - Access-Control-Allow-Headers: - - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, - x-b3-sampled, x-b3-flags - Vary: - - Accept-Encoding - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - Referrer-Policy: - - no-referrer - Content-Length: - - '688' - Content-Type: - - application/json; charset=utf-8 - X-Via: - - haproxy-www-sd3m,haproxy-edge-pdx-ed3w - body: - encoding: ASCII-8BIT - string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super - random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This - channel is for... well, everything else. It\u2019s a place for team jokes, - spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very - general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This - is the one channel that will always include everyone. It\u2019s a great spot - for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This - *channel* is for working on a project. Hold meetings, share docs, and make - decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 01:01:07 GMT -- request: - method: get - uri: https://slack.com/api/users.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 08 Oct 2020 17:28:43 GMT - Server: - - Apache - X-Slack-Req-Id: - - 720274f09f3fadcc2d852e3dfeb80b39 + - 01420f7f5caae8c074a522b7cac95b54 X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -203,7 +58,7 @@ http_interactions: Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-pqd0,haproxy-edge-iad-y9g6 + - haproxy-www-ce55,haproxy-edge-iad-aovy body: encoding: ASCII-8BIT string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific @@ -217,11 +72,11 @@ http_interactions: - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602178123,"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 17:28:43 GMT + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602192281,"response_metadata":{"next_cursor":""}}' + recorded_at: Thu, 08 Oct 2020 21:24:41 GMT - request: method: get - uri: https://slack.com/api/conversations.list?token=xoxp-1411248079363-1396306129959-1417231027620-3087b574933edc413a334e5615781964 + uri: https://slack.com/api/conversations.list?token= body: encoding: US-ASCII string: '' @@ -238,11 +93,11 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 17:28:43 GMT + - Thu, 08 Oct 2020 21:24:42 GMT Server: - Apache X-Slack-Req-Id: - - b687edd647aca871fa9902099847bf11 + - 7b255da3718af722e7f700add2d87ed1 X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -273,21 +128,21 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '688' + - '692' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-a9vn,haproxy-edge-iad-jze3 + - haproxy-www-n4uf,haproxy-edge-iad-rwys body: encoding: ASCII-8BIT string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This channel is for... well, everything else. It\u2019s a place for team jokes, - spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":2},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very + spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":4},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This is the one channel that will always include everyone. It\u2019s a great spot for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This *channel* is for working on a project. Hold meetings, share docs, and make decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 17:28:43 GMT + recorded_at: Thu, 08 Oct 2020 21:24:42 GMT recorded_with: VCR 6.0.0 diff --git a/test/channel_test.rb b/test/channel_test.rb index a4958fc6..ca983136 100644 --- a/test/channel_test.rb +++ b/test/channel_test.rb @@ -1,27 +1,35 @@ require_relative 'test_helper' describe "Channel class" do - # let(:user) { User.new } describe "list_all" do it "get channels" do VCR.use_cassette("channel") do response = Channel.list_all + expect(response[0].name).wont_be_nil + expect(response[0].name).must_equal "random" + expect(response[0].slack_id).must_equal "C01BW93UN8N" + expect(response[0].member_count).must_equal 4 + end + end + end - expect(response["channels"][0]["name"]).wont_be_nil - expect(response["channels"][0]["name"]).must_equal "random" - expect(response["channels"][0]["id"]).must_equal "C01BW93UN8N" - expect(response["channels"][0]["num_members"]).must_equal 2 + describe "send_message" do + it "recipient" do + VCR.use_cassette("channel") do + expect { + new_recipient = Channel.new(slack_id: "fake", name: "fake", topic: "fake", member_count: "fake") + new_recipient.send_message("This post should not work") + }.must_raise SlackApiError end end + end - # it "will raise an exception if the search fails" do - # VCR.use_cassette("location_find") do - # location = "" - # expect { - # response = get_location(location) - # }.must_raise SearchError - # end - # end + describe "details" do + it "must return correct details" do + test_channel = Channel.new(slack_id: "12345", name: "ida.goitom", topic: "happy", member_count: 5) + expect(test_channel.details).must_equal "Name: ida.goitom, ID: 12345, Topic: happy, Member count: 5" + end end + end \ No newline at end of file diff --git a/test/test_helper.rb b/test/test_helper.rb index 6c820fca..575ee716 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,7 +13,6 @@ require_relative '../lib/slack' Dotenv.load - Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new VCR.configure do |config| @@ -30,7 +29,7 @@ } # Don't leave our token lying around in a cassette file. - config.filter_sensitive_data("") do - ENV["LOCATIONIQ_TOKEN"] + config.filter_sensitive_data("") do + ENV["SLACK_API_TOKEN"] end end diff --git a/test/user_test.rb b/test/user_test.rb index 06d7fe38..4a495867 100644 --- a/test/user_test.rb +++ b/test/user_test.rb @@ -1,16 +1,15 @@ require_relative 'test_helper' describe "User class" do - let(:user) { User.new } describe "list_all" do it "get users" do VCR.use_cassette("user") do response = User.list_all - expect(response["members"][0]["name"]).wont_be_nil - expect(response["members"][0]["name"]).must_equal "slackbot" - expect(response["members"][0]["real_name"]).must_equal "Slackbot" + expect(response[0].name).wont_be_nil + expect(response[0].name).must_equal "slackbot" + expect(response[0].real_name).must_equal "Slackbot" end end diff --git a/test/workspace_test.rb b/test/workspace_test.rb index 251b0bf7..8425dc73 100644 --- a/test/workspace_test.rb +++ b/test/workspace_test.rb @@ -15,9 +15,9 @@ describe 'select_user' do it "selects the user" do - VCR.use_cassette("name") do + VCR.use_cassette("workspace") do workspace.select_user("ida.goitom") - expect(workspace.selected["name"]).must_equal "ida.goitom" + expect(workspace.selected.name).must_equal "ida.goitom" end end end @@ -26,9 +26,19 @@ it "selects the right channel when provided name or ID" do VCR.use_cassette("workspace") do workspace.select_channel("random") - expect(workspace.selected["name"]).must_equal "random" + expect(workspace.selected.name).must_equal "random" end end end + + it "will raise an error when given an invalid channel" do + # VCR.use_cassette("slack-posts") do + # exception = expect { + # new_recipient = Recipient.new() + # .send_message("This post should not work", "invalid-channel") + # }.must_raise SlackApiError + # + # expect(exception.message).must_equal 'Error when posting This post should not work to invalid-channel, error: channel_not_found' + end end From c164243b38f5fa74e88dd9e9b78c0e54dcca1d8e Mon Sep 17 00:00:00 2001 From: Ida Date: Thu, 8 Oct 2020 15:02:48 -0700 Subject: [PATCH 7/9] updated user details --- .idea/slack-cli.iml | 2 +- test/user_test.rb | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.idea/slack-cli.iml b/.idea/slack-cli.iml index e2fedfc5..329312d1 100644 --- a/.idea/slack-cli.iml +++ b/.idea/slack-cli.iml @@ -18,7 +18,7 @@ - + diff --git a/test/user_test.rb b/test/user_test.rb index 4a495867..4bdeec0d 100644 --- a/test/user_test.rb +++ b/test/user_test.rb @@ -12,14 +12,12 @@ expect(response[0].real_name).must_equal "Slackbot" end end + end - # it "will raise an exception if the search fails" do - # VCR.use_cassette("location_find") do - # location = "" - # expect { - # response = get_location(location) - # }.must_raise SearchError - # end - # end + describe "details" do + it "must return correct details" do + test_user = User.new(slack_id: "891012", name: "anna" , real_name: "anna") + expect(test_user.details).must_equal "Name: anna, ID: 891012, Username: anna" + end end -end \ No newline at end of file +end From 1807024a76c325f522baf4b26ad1b84f368e0513 Mon Sep 17 00:00:00 2001 From: Ida Date: Fri, 9 Oct 2020 10:35:54 -0700 Subject: [PATCH 8/9] added new tests --- lib/recipient.rb | 2 +- lib/user.rb | 2 - test/cassettes/channel.yml | 84 ++++++++++++++++++------------------ test/cassettes/user.yml | 18 ++++---- test/cassettes/workspace.yml | 30 +++++++------ test/channel_test.rb | 7 +++ test/workspace_test.rb | 10 ----- 7 files changed, 77 insertions(+), 76 deletions(-) diff --git a/lib/recipient.rb b/lib/recipient.rb index ca7abbe5..e5c4f177 100644 --- a/lib/recipient.rb +++ b/lib/recipient.rb @@ -40,7 +40,7 @@ def send_message(message) unless response.code == 200 && response.parsed_response["ok"] raise SlackApiError, "Error when posting #{message} to #{@slack_id}, error: #{response.parsed_response["error"]}" end - + return response end def details diff --git a/lib/user.rb b/lib/user.rb index 73892a5f..13f8b732 100644 --- a/lib/user.rb +++ b/lib/user.rb @@ -6,8 +6,6 @@ class User < Recipient def initialize(slack_id:, name:, real_name:) super(slack_id: slack_id, name: name) @real_name = real_name - # @status_text - # @status_emoji end def details diff --git a/test/cassettes/channel.yml b/test/cassettes/channel.yml index a9feaff0..73a26587 100644 --- a/test/cassettes/channel.yml +++ b/test/cassettes/channel.yml @@ -1,12 +1,14 @@ --- http_interactions: - request: - method: get - uri: https://slack.com/api/conversations.list?token= + method: post + uri: https://slack.com/api/chat.postMessage body: - encoding: US-ASCII - string: '' + encoding: UTF-8 + string: token=xoxb-1411248079363-1404340511606-LW6ZsnAsDY3pR2vibGHzMER5&channel=fake&text=This%20post%20should%20not%20work headers: + Content-Type: + - application/x-www-form-urlencoded Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -19,13 +21,13 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 21:24:45 GMT + - Fri, 09 Oct 2020 17:33:28 GMT Server: - Apache X-Slack-Req-Id: - - 69d06e9f6e6b5f0b8c43ef166cea2956 + - 81641afa739535142f8ea5460e120c80 X-Oauth-Scopes: - - identify,channels:read,users:read,chat:write + - chat:write,users:read,channels:read Access-Control-Expose-Headers: - x-slack-req-id, retry-after Access-Control-Allow-Origin: @@ -41,7 +43,7 @@ http_interactions: X-Xss-Protection: - '0' X-Accepted-Oauth-Scopes: - - channels:read,groups:read,mpim:read,im:read,read + - chat:write Access-Control-Allow-Headers: - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags @@ -54,29 +56,21 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '692' + - '60' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-yo7l,haproxy-edge-iad-bbo4 + - haproxy-www-kg4q,haproxy-edge-pdx-paag body: encoding: ASCII-8BIT - string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super - random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This - channel is for... well, everything else. It\u2019s a place for team jokes, - spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":4},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very - general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This - is the one channel that will always include everyone. It\u2019s a great spot - for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This - *channel* is for working on a project. Hold meetings, share docs, and make - decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 21:24:45 GMT + string: '{"ok":false,"error":"channel_not_found"}' + recorded_at: Fri, 09 Oct 2020 17:33:29 GMT - request: method: post uri: https://slack.com/api/chat.postMessage body: encoding: UTF-8 - string: token=xoxb-1411248079363-1404340511606-j0fNU7www00xC96MLNvW9LiQ&channel=fake&text=This%20post%20should%20not%20work + string: token=xoxb-1411248079363-1404340511606-LW6ZsnAsDY3pR2vibGHzMER5&channel=C01BW93UN8N&text=hello%20testing headers: Content-Type: - application/x-www-form-urlencoded @@ -92,11 +86,11 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 21:48:43 GMT + - Fri, 09 Oct 2020 17:33:29 GMT Server: - Apache X-Slack-Req-Id: - - 68b4338d0614013933751b1195290491 + - 7a884afa51a599b5dac635f5f2bb742f X-Oauth-Scopes: - chat:write,users:read,channels:read Access-Control-Expose-Headers: @@ -127,24 +121,24 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '60' + - '334' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-dqm5,haproxy-edge-pdx-1x0h + - haproxy-www-sres,haproxy-edge-pdx-jxbh body: encoding: ASCII-8BIT - string: '{"ok":false,"error":"channel_not_found"}' - recorded_at: Thu, 08 Oct 2020 21:48:43 GMT + string: '{"ok":true,"channel":"C01BW93UN8N","ts":"1602264809.000500","message":{"bot_id":"B01BN9RATAB","type":"message","text":"hello + testing","user":"U01BWA0F1HU","ts":"1602264809.000500","team":"T01C37A2BAP","bot_profile":{"id":"B01BN9RATAB","deleted":false,"name":"C14 + - Ida - API Project","updated":1602264225,"app_id":"A01C37SFXEX","icons":{"image_36":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_36.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/service_72.png"},"team_id":"T01C37A2BAP"}}}' + recorded_at: Fri, 09 Oct 2020 17:33:29 GMT - request: - method: post - uri: https://slack.com/api/chat.postMessage + method: get + uri: https://slack.com/api/conversations.list?token= body: - encoding: UTF-8 - string: token=xoxb-1411248079363-1411069541026-h2T6zZv2KCGYwTwRUEfsYZsp&channel=fake&text=This%20post%20should%20not%20work + encoding: US-ASCII + string: '' headers: - Content-Type: - - application/x-www-form-urlencoded Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -157,13 +151,13 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 21:55:10 GMT + - Fri, 09 Oct 2020 17:33:34 GMT Server: - Apache X-Slack-Req-Id: - - e0cd0634a1b909be8d0f2b00ab4abc14 + - 70d1a7bf5f59e9e8d874bfdfbfb691a0 X-Oauth-Scopes: - - chat:write,channels:read,users:read + - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: - x-slack-req-id, retry-after Access-Control-Allow-Origin: @@ -179,7 +173,7 @@ http_interactions: X-Xss-Protection: - '0' X-Accepted-Oauth-Scopes: - - chat:write + - channels:read,groups:read,mpim:read,im:read,read Access-Control-Allow-Headers: - slack-route, x-slack-version-ts, x-b3-traceid, x-b3-spanid, x-b3-parentspanid, x-b3-sampled, x-b3-flags @@ -192,13 +186,21 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '60' + - '692' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-m88x,haproxy-edge-iad-kz0s + - haproxy-www-oppt,haproxy-edge-pdx-68eo body: encoding: ASCII-8BIT - string: '{"ok":false,"error":"channel_not_found"}' - recorded_at: Thu, 08 Oct 2020 21:55:10 GMT + string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super + random!","creator":"U01BN903TU7","last_set":1602021102},"purpose":{"value":"This + channel is for... well, everything else. It\u2019s a place for team jokes, + spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":4},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very + general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This + is the one channel that will always include everyone. It\u2019s a great spot + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":3},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + *channel* is for working on a project. Hold meetings, share docs, and make + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":3}],"response_metadata":{"next_cursor":""}}' + recorded_at: Fri, 09 Oct 2020 17:33:34 GMT recorded_with: VCR 6.0.0 diff --git a/test/cassettes/user.yml b/test/cassettes/user.yml index c2729599..e958f4cc 100644 --- a/test/cassettes/user.yml +++ b/test/cassettes/user.yml @@ -19,11 +19,11 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 21:24:44 GMT + - Fri, 09 Oct 2020 17:33:32 GMT Server: - Apache X-Slack-Req-Id: - - a7ca9503e0f8f09e2ea373def13091e1 + - a96df2697cdd7bf8fea96c2ee41eb0cc X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -54,11 +54,11 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '1315' + - '1341' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-008d,haproxy-edge-iad-tl66 + - haproxy-www-3b8m,haproxy-edge-pdx-r6b3 body: encoding: ASCII-8BIT string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific @@ -68,10 +68,12 @@ http_interactions: Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 - - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","first_name":"C14","last_name":"- + Ida - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602264225},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602192284,"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 21:24:44 GMT + - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","first_name":"Fire","last_name":"- + Anna - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602196479},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602264812,"response_metadata":{"next_cursor":""}}' + recorded_at: Fri, 09 Oct 2020 17:33:32 GMT recorded_with: VCR 6.0.0 diff --git a/test/cassettes/workspace.yml b/test/cassettes/workspace.yml index 45b9b67b..6061d4b8 100644 --- a/test/cassettes/workspace.yml +++ b/test/cassettes/workspace.yml @@ -19,11 +19,11 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 21:24:41 GMT + - Fri, 09 Oct 2020 17:33:30 GMT Server: - Apache X-Slack-Req-Id: - - 01420f7f5caae8c074a522b7cac95b54 + - ea8129a03e49e3ba5574ee72df2d751b X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -54,11 +54,11 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '1315' + - '1342' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-ce55,haproxy-edge-iad-aovy + - haproxy-www-82hb,haproxy-edge-pdx-1cbr body: encoding: ASCII-8BIT string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific @@ -68,12 +68,14 @@ http_interactions: Kim","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"a203b1bd15bb","image_original":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_original.jpg","is_custom_image":true,"image_24":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_24.jpg","image_32":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_32.jpg","image_48":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_48.jpg","image_72":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_72.jpg","image_192":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_192.jpg","image_512":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_512.jpg","image_1024":"https:\/\/avatars.slack-edge.com\/2020-10-06\/1434891540032_a203b1bd15bb3f14de6a_1024.jpg","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015284,"has_2fa":false},{"id":"U01BWA0F1HU","team_id":"T01C37A2BAP","name":"c14_ida_api_project","deleted":false,"color":"3c989f","real_name":"C14 - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 - - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015870},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","first_name":"C14","last_name":"- + Ida - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602264225},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602015825},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081}],"cache_ts":1602192281,"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 21:24:41 GMT + - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","first_name":"Fire","last_name":"- + Anna - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602196479},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602264810,"response_metadata":{"next_cursor":""}}' + recorded_at: Fri, 09 Oct 2020 17:33:30 GMT - request: method: get uri: https://slack.com/api/conversations.list?token= @@ -93,11 +95,11 @@ http_interactions: message: OK headers: Date: - - Thu, 08 Oct 2020 21:24:42 GMT + - Fri, 09 Oct 2020 17:33:31 GMT Server: - Apache X-Slack-Req-Id: - - 7b255da3718af722e7f700add2d87ed1 + - a106da5cd0545b274e45699f17fec8e1 X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -132,7 +134,7 @@ http_interactions: Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-n4uf,haproxy-edge-iad-rwys + - haproxy-www-grrn,haproxy-edge-pdx-r6b3 body: encoding: ASCII-8BIT string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super @@ -141,8 +143,8 @@ http_interactions: spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":4},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This is the one channel that will always include everyone. It\u2019s a great spot - for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":2},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":3},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This *channel* is for working on a project. Hold meetings, share docs, and make - decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' - recorded_at: Thu, 08 Oct 2020 21:24:42 GMT + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":3}],"response_metadata":{"next_cursor":""}}' + recorded_at: Fri, 09 Oct 2020 17:33:31 GMT recorded_with: VCR 6.0.0 diff --git a/test/channel_test.rb b/test/channel_test.rb index ca983136..04e41b3e 100644 --- a/test/channel_test.rb +++ b/test/channel_test.rb @@ -23,6 +23,13 @@ }.must_raise SlackApiError end end + it "sends a message to a channel" do + VCR.use_cassette("channel") do + new_recipient = Channel.new(slack_id: "C01BW93UN8N", name: "random", topic: "super random!", member_count: 3) + expect(new_recipient.send_message("hello testing").code).must_equal 200 + end + end + end describe "details" do diff --git a/test/workspace_test.rb b/test/workspace_test.rb index 8425dc73..b14a1ed0 100644 --- a/test/workspace_test.rb +++ b/test/workspace_test.rb @@ -30,15 +30,5 @@ end end end - - it "will raise an error when given an invalid channel" do - # VCR.use_cassette("slack-posts") do - # exception = expect { - # new_recipient = Recipient.new() - # .send_message("This post should not work", "invalid-channel") - # }.must_raise SlackApiError - # - # expect(exception.message).must_equal 'Error when posting This post should not work to invalid-channel, error: channel_not_found' - end end From 0b890a19fe061fb44b93711db7a12780e59805a3 Mon Sep 17 00:00:00 2001 From: Ida Date: Fri, 9 Oct 2020 10:44:16 -0700 Subject: [PATCH 9/9] deleted file --- sandbox.rb | 1 - test/cassettes/channel.yml | 40 ++++++++++++++++++------------------ test/cassettes/user.yml | 14 ++++++------- test/cassettes/workspace.yml | 26 +++++++++++------------ 4 files changed, 40 insertions(+), 41 deletions(-) delete mode 100644 sandbox.rb diff --git a/sandbox.rb b/sandbox.rb deleted file mode 100644 index 0b9226b5..00000000 --- a/sandbox.rb +++ /dev/null @@ -1 +0,0 @@ -# require 'httparty' \ No newline at end of file diff --git a/test/cassettes/channel.yml b/test/cassettes/channel.yml index 73a26587..6ab817cf 100644 --- a/test/cassettes/channel.yml +++ b/test/cassettes/channel.yml @@ -5,7 +5,7 @@ http_interactions: uri: https://slack.com/api/chat.postMessage body: encoding: UTF-8 - string: token=xoxb-1411248079363-1404340511606-LW6ZsnAsDY3pR2vibGHzMER5&channel=fake&text=This%20post%20should%20not%20work + string: token=xoxb-1411248079363-1404340511606-fOwOmFcNFbWUGeb3ZyMTMXRE&channel=fake&text=This%20post%20should%20not%20work headers: Content-Type: - application/x-www-form-urlencoded @@ -21,11 +21,11 @@ http_interactions: message: OK headers: Date: - - Fri, 09 Oct 2020 17:33:28 GMT + - Fri, 09 Oct 2020 17:43:47 GMT Server: - Apache X-Slack-Req-Id: - - 81641afa739535142f8ea5460e120c80 + - 2d733a8d8fccc28aa59eaff2366e7ea2 X-Oauth-Scopes: - chat:write,users:read,channels:read Access-Control-Expose-Headers: @@ -60,17 +60,17 @@ http_interactions: Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-kg4q,haproxy-edge-pdx-paag + - haproxy-www-na7m,haproxy-edge-pdx-gxzc body: encoding: ASCII-8BIT string: '{"ok":false,"error":"channel_not_found"}' - recorded_at: Fri, 09 Oct 2020 17:33:29 GMT + recorded_at: Fri, 09 Oct 2020 17:43:47 GMT - request: method: post uri: https://slack.com/api/chat.postMessage body: encoding: UTF-8 - string: token=xoxb-1411248079363-1404340511606-LW6ZsnAsDY3pR2vibGHzMER5&channel=C01BW93UN8N&text=hello%20testing + string: token=xoxb-1411248079363-1404340511606-fOwOmFcNFbWUGeb3ZyMTMXRE&channel=C01BW93UN8N&text=hello%20testing headers: Content-Type: - application/x-www-form-urlencoded @@ -86,11 +86,11 @@ http_interactions: message: OK headers: Date: - - Fri, 09 Oct 2020 17:33:29 GMT + - Fri, 09 Oct 2020 17:43:48 GMT Server: - Apache X-Slack-Req-Id: - - 7a884afa51a599b5dac635f5f2bb742f + - d08fe44cee134d767061fb96d409e63a X-Oauth-Scopes: - chat:write,users:read,channels:read Access-Control-Expose-Headers: @@ -125,13 +125,13 @@ http_interactions: Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-sres,haproxy-edge-pdx-jxbh + - haproxy-www-ngke,haproxy-edge-pdx-locq body: encoding: ASCII-8BIT - string: '{"ok":true,"channel":"C01BW93UN8N","ts":"1602264809.000500","message":{"bot_id":"B01BN9RATAB","type":"message","text":"hello - testing","user":"U01BWA0F1HU","ts":"1602264809.000500","team":"T01C37A2BAP","bot_profile":{"id":"B01BN9RATAB","deleted":false,"name":"C14 - - Ida - API Project","updated":1602264225,"app_id":"A01C37SFXEX","icons":{"image_36":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_36.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/service_72.png"},"team_id":"T01C37A2BAP"}}}' - recorded_at: Fri, 09 Oct 2020 17:33:29 GMT + string: '{"ok":true,"channel":"C01BW93UN8N","ts":"1602265428.001000","message":{"bot_id":"B01BN9RATAB","type":"message","text":"hello + testing","user":"U01BWA0F1HU","ts":"1602265428.001000","team":"T01C37A2BAP","bot_profile":{"id":"B01BN9RATAB","deleted":false,"name":"C14 + - Ida - API Project","updated":1602265137,"app_id":"A01C37SFXEX","icons":{"image_36":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_36.png","image_48":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/bot_48.png","image_72":"https:\/\/a.slack-edge.com\/80588\/img\/plugins\/app\/service_72.png"},"team_id":"T01C37A2BAP"}}}' + recorded_at: Fri, 09 Oct 2020 17:43:48 GMT - request: method: get uri: https://slack.com/api/conversations.list?token= @@ -151,11 +151,11 @@ http_interactions: message: OK headers: Date: - - Fri, 09 Oct 2020 17:33:34 GMT + - Fri, 09 Oct 2020 17:43:49 GMT Server: - Apache X-Slack-Req-Id: - - 70d1a7bf5f59e9e8d874bfdfbfb691a0 + - 33a3b5c979172b5149b7fe0b0ef36251 X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -186,11 +186,11 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '692' + - '691' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-oppt,haproxy-edge-pdx-68eo + - haproxy-www-7n0o,haproxy-edge-pdx-pim9 body: encoding: ASCII-8BIT string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super @@ -199,8 +199,8 @@ http_interactions: spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":4},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This is the one channel that will always include everyone. It\u2019s a great spot - for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":3},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":4},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This *channel* is for working on a project. Hold meetings, share docs, and make - decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":3}],"response_metadata":{"next_cursor":""}}' - recorded_at: Fri, 09 Oct 2020 17:33:34 GMT + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' + recorded_at: Fri, 09 Oct 2020 17:43:49 GMT recorded_with: VCR 6.0.0 diff --git a/test/cassettes/user.yml b/test/cassettes/user.yml index e958f4cc..1203fc45 100644 --- a/test/cassettes/user.yml +++ b/test/cassettes/user.yml @@ -19,11 +19,11 @@ http_interactions: message: OK headers: Date: - - Fri, 09 Oct 2020 17:33:32 GMT + - Fri, 09 Oct 2020 17:43:51 GMT Server: - Apache X-Slack-Req-Id: - - a96df2697cdd7bf8fea96c2ee41eb0cc + - d0d8551062a5800e36f1cb7ee92e70cc X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -54,11 +54,11 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '1341' + - '1342' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-3b8m,haproxy-edge-pdx-r6b3 + - haproxy-www-98pr,haproxy-edge-pdx-1350 body: encoding: ASCII-8BIT string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific @@ -69,11 +69,11 @@ http_interactions: - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","first_name":"C14","last_name":"- - Ida - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602264225},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + Ida - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602265137},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","first_name":"Fire","last_name":"- Anna - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602196479},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602264812,"response_metadata":{"next_cursor":""}}' - recorded_at: Fri, 09 Oct 2020 17:33:32 GMT + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602265431,"response_metadata":{"next_cursor":""}}' + recorded_at: Fri, 09 Oct 2020 17:43:51 GMT recorded_with: VCR 6.0.0 diff --git a/test/cassettes/workspace.yml b/test/cassettes/workspace.yml index 6061d4b8..ebab3a35 100644 --- a/test/cassettes/workspace.yml +++ b/test/cassettes/workspace.yml @@ -19,11 +19,11 @@ http_interactions: message: OK headers: Date: - - Fri, 09 Oct 2020 17:33:30 GMT + - Fri, 09 Oct 2020 17:43:46 GMT Server: - Apache X-Slack-Req-Id: - - ea8129a03e49e3ba5574ee72df2d751b + - 656429dbe3999f0504d3078281b235e5 X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -58,7 +58,7 @@ http_interactions: Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-82hb,haproxy-edge-pdx-1cbr + - haproxy-www-oxoh,haproxy-edge-pdx-8ea4 body: encoding: ASCII-8BIT string: '{"ok":true,"members":[{"id":"USLACKBOT","team_id":"T01C37A2BAP","name":"slackbot","deleted":false,"color":"757575","real_name":"Slackbot","tz":"America\/Los_Angeles","tz_label":"Pacific @@ -69,13 +69,13 @@ http_interactions: - Ida - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"C14 - Ida - API Project","real_name_normalized":"C14 - Ida - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g49c0e26fbc0","api_app_id":"A01C37SFXEX","always_active":false,"bot_id":"B01BN9RATAB","first_name":"C14","last_name":"- - Ida - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602264225},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire + Ida - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/49c0e26fbc009f1477edb016e33c0538.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602265137},{"id":"U01C321FX0S","team_id":"T01C37A2BAP","name":"fire_anna_api_project","deleted":false,"color":"e7392d","real_name":"Fire - Anna - API Project","tz":"America\/Los_Angeles","tz_label":"Pacific Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"Fire - Anna - API Project","real_name_normalized":"Fire - Anna - API Project","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"gb8fb0a1ad1a","api_app_id":"A01BZUFBESZ","always_active":false,"bot_id":"B01C384T91R","first_name":"Fire","last_name":"- Anna - API Project","image_24":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/b8fb0a1ad1a4a57f392bde7157d0e26f.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0000-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":false,"is_owner":false,"is_primary_owner":false,"is_restricted":false,"is_ultra_restricted":false,"is_bot":true,"is_app_user":false,"updated":1602196479},{"id":"U01C95Y5RUL","team_id":"T01C37A2BAP","name":"ida.goitom","deleted":false,"color":"9f69e7","real_name":"ida.goitom","tz":"America\/Los_Angeles","tz_label":"Pacific - Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602264810,"response_metadata":{"next_cursor":""}}' - recorded_at: Fri, 09 Oct 2020 17:33:30 GMT + Daylight Time","tz_offset":-25200,"profile":{"title":"","phone":"","skype":"","real_name":"ida.goitom","real_name_normalized":"ida.goitom","display_name":"","display_name_normalized":"","fields":null,"status_text":"","status_emoji":"","status_expiration":0,"avatar_hash":"g8213e08b600","image_24":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png","image_32":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png","image_48":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png","image_72":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png","image_192":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png","image_512":"https:\/\/secure.gravatar.com\/avatar\/8213e08b600990ea9cc0628ea90eb078.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png","status_text_canonical":"","team":"T01C37A2BAP"},"is_admin":true,"is_owner":true,"is_primary_owner":true,"is_restricted":false,"is_ultra_restricted":false,"is_bot":false,"is_app_user":false,"updated":1602015081,"has_2fa":false}],"cache_ts":1602265426,"response_metadata":{"next_cursor":""}}' + recorded_at: Fri, 09 Oct 2020 17:43:46 GMT - request: method: get uri: https://slack.com/api/conversations.list?token= @@ -95,11 +95,11 @@ http_interactions: message: OK headers: Date: - - Fri, 09 Oct 2020 17:33:31 GMT + - Fri, 09 Oct 2020 17:43:46 GMT Server: - Apache X-Slack-Req-Id: - - a106da5cd0545b274e45699f17fec8e1 + - b51e2a4e145fcc744fe159ee4e19ee59 X-Oauth-Scopes: - identify,channels:read,users:read,chat:write Access-Control-Expose-Headers: @@ -130,11 +130,11 @@ http_interactions: Referrer-Policy: - no-referrer Content-Length: - - '692' + - '691' Content-Type: - application/json; charset=utf-8 X-Via: - - haproxy-www-grrn,haproxy-edge-pdx-r6b3 + - haproxy-www-fe3y,haproxy-edge-pdx-ttqn body: encoding: ASCII-8BIT string: '{"ok":true,"channels":[{"id":"C01BW93UN8N","name":"random","is_channel":true,"is_group":false,"is_im":false,"created":1602015082,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"random","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"super @@ -143,8 +143,8 @@ http_interactions: spur-of-the-moment ideas, and funny GIFs. Go wild!","creator":"U01C95Y5RUL","last_set":1602015082},"previous_names":[],"num_members":4},{"id":"C01C37A2T1R","name":"general","is_channel":true,"is_group":false,"is_im":false,"created":1602015081,"is_archived":false,"is_general":true,"unlinked":0,"name_normalized":"general","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"very general","creator":"U01BN903TU7","last_set":1602021116},"purpose":{"value":"This is the one channel that will always include everyone. It\u2019s a great spot - for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":3},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This + for announcements and team-wide conversations.","creator":"U01C95Y5RUL","last_set":1602015081},"previous_names":[],"num_members":4},{"id":"C01CSS4N2QG","name":"slack-cli","is_channel":true,"is_group":false,"is_im":false,"created":1602015214,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"slack-cli","is_shared":false,"parent_conversation":null,"creator":"U01C95Y5RUL","is_ext_shared":false,"is_org_shared":false,"shared_team_ids":["T01C37A2BAP"],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":false,"is_mpim":false,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"This *channel* is for working on a project. Hold meetings, share docs, and make - decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":3}],"response_metadata":{"next_cursor":""}}' - recorded_at: Fri, 09 Oct 2020 17:33:31 GMT + decisions together with your team.","creator":"U01C95Y5RUL","last_set":1602015214},"previous_names":[],"num_members":2}],"response_metadata":{"next_cursor":""}}' + recorded_at: Fri, 09 Oct 2020 17:43:46 GMT recorded_with: VCR 6.0.0