-
Notifications
You must be signed in to change notification settings - Fork 27
Ports - Margaret and Ari #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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
|
| # TODO project | ||
|
|
||
| puts "Thank you for using the Ada Slack CLI" | ||
| until response == "7" || response == "quit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thank god you respond to the numbers!
|
|
||
| selected_user = "" | ||
|
|
||
| response["members"].each do |member| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| end | ||
|
|
||
| describe "see_details" do | ||
| it "shows details for selected user" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have missed an opportunity to create an array of Channel instances instead of an array of hashes.
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions