-
Notifications
You must be signed in to change notification settings - Fork 27
Sockets - Erica and Kelly #8
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
…rkspace, fixed workspace test
…ar. Need to update output for the options
…sage and some refactoring
slack.rbWhat We're Looking For
|
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions