-
Couldn't load subscription status.
- Fork 27
Sockets - Carla && Shubha #2
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
slack.rbWhat We're Looking For
|
| def select_channel(name_or_id) | ||
| @selected = channels.find { |channel| channel.name == name_or_id } | ||
| @selected ||= channels.find { |channel| channel.slack_id == name_or_id } | ||
| return @selected |
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.
Good use of ||= here.
| it "selects a channel by name" do | ||
| channel = @new_workspace.channels.first | ||
| name = @new_workspace.channels.first.name | ||
| expect(@new_workspace.select_channel(name)).must_equal 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.
What if you try to select a user/channel that does not exist?
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions