Open
Conversation
…rkspace, fixed workspace test
…ar. Need to update output for the options
…sage and some refactoring
slack.rbWhat We're Looking For
|
droberts-sea
reviewed
Apr 1, 2019
| def find_channel(channel_info) | ||
| @channels.each do |channel| | ||
| if channel_info == channel.slack_id || channel_info == channel.name | ||
| return channel |
There was a problem hiding this comment.
This code and find_user above are almost exactly the same. Could you DRY this up?
| it "should return nil, given invalid user" do | ||
| bad_username = "" | ||
| @workspace.select_user(bad_username) | ||
| expect(@workspace.selected).must_be_nil |
There was a problem hiding this comment.
If a user was previously selected, what should happen to that user?
| it "returns nil if selected is nil" do | ||
| if @workspace.selected == nil | ||
| expect(@workspace.show_details).must_be_nil | ||
| end |
There was a problem hiding this comment.
You've done a great job of identifying and testing for failure cases throughout this project.
| url = "https://slack.com/api/users.list" | ||
| data = { | ||
| "token": ENV["SLACK_API_TOKEN"], | ||
| } |
There was a problem hiding this comment.
Most of this data is going to be common to all subclasses of Recipient, the only thing that's changing is the end of the URL (users.list). Could you move some or all of it to Recipient.get?
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