Open
Conversation
slack.rbWhat We're Looking For
|
CheezItMan
reviewed
Mar 31, 2019
| require "HTTParty" | ||
| require "dotenv" | ||
| Dotenv.load | ||
|
|
There was a problem hiding this comment.
I really like you having an API wrapper module here. It helps separate out the API from the rest of the app.
| return "Name: #{name}, \nID: #{id}, \nTopic: #{topic}, \nMember Count: #{member_count}" | ||
| end | ||
|
|
||
| def self.create_channels |
There was a problem hiding this comment.
Maybe this method would be better named list_channels.
| @name = name | ||
| @id = id | ||
| end | ||
|
|
There was a problem hiding this comment.
You could also have an abstract method called list which both user and Channel implement.
| end | ||
|
|
||
| def find_user(input:) | ||
| users.each do |user| |
| require_relative "test_helper" | ||
|
|
||
| describe "Api Wrapper module" do | ||
| describe "Api Wrapper module" do |
There was a problem hiding this comment.
These two describes have the same text.
| describe "ApiWrapper.get_channels" do | ||
| it "will return a Response object" do | ||
| VCR.use_cassette("slack_api") do | ||
| response = Slack::ApiWrapper.get_channels |
There was a problem hiding this comment.
You should also verify that it returns the right format of data.
| end | ||
| end | ||
|
|
||
| describe "Workspace#find_channel" do |
There was a problem hiding this comment.
You also need a test with an invalid channel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions
GETrequest, our program is the client that sends the request to the server (Slack API) to gather all information about channels and users. Once the Slack API received our request, it would return a response (in JSON format) to us.SlackError(a subclass ofStandardError) whenever the response["ok"] isfalse. We wrapped the begin/rescue block around methods that make network calls to enhance users' experience.