Conversation
…ils method & tests to user
… channel details to accomodate table print. Updated slack.rb to use table print
… workspace. Moved associated tests to workspace
slack.rbWhat We're Looking For
|
CheezItMan
reviewed
Mar 31, 2019
| # TODO project | ||
|
|
||
| puts "Thank you for using the Ada Slack CLI" | ||
| until response == "7" || response == "quit" |
There was a problem hiding this comment.
Oh thank god you respond to the numbers!
|
|
||
| selected_user = "" | ||
|
|
||
| response["members"].each do |member| |
There was a problem hiding this comment.
You could also use the .find method as well.
| expect(response.length).must_equal 3 | ||
| end | ||
| end | ||
| it "will raise an error if given an invalid key" do |
| end | ||
|
|
||
| describe "see_details" do | ||
| it "shows details for selected user" do |
There was a problem hiding this comment.
What about when no user has been selected. You also have 2 describe blocks with the same "see_details" description... Little odd
|
|
||
| puts "Thank you for using the Ada Slack CLI" | ||
| until response == "7" || response == "quit" | ||
| if response == "list users" || response == "1" |
There was a problem hiding this comment.
This set of if-else blocks, really looks like it could be broken up into methods.
|
|
||
| if response["ok"] | ||
| response["members"].each do |member| | ||
| user_list << {"name" => member["name"], "real name" => member["real_name"], "slack id" => member["id"]} |
There was a problem hiding this comment.
This method would make more sense if it returned a list of User instances with name, read name and id properties.
| raise SlackAPI::SlackError, "There was an error. The error message is #{response["error"]}" | ||
| else | ||
| response["channels"].each do |channel| | ||
| channel_list << { "name" => channel["name"], "topic" => channel["topic"]["value"], "member count" => channel["members"].length, "id" => channel["id"] } |
There was a problem hiding this comment.
You have missed an opportunity to create an array of Channel instances instead of an array of hashes.
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