-
Notifications
You must be signed in to change notification settings - Fork 27
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
Ports - Faiza & Stephanie #19
base: master
Are you sure you want to change the base?
Conversation
…eated classes Channel, User and Workspace. Added Initialize method in Channel and wrote a corresponding test.
slack.rbWhat We're Looking For
|
end | ||
|
||
def channel_details | ||
super.push("topic", "member_count") |
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.
Clever, except that the Recipient
class doesn't have a channel_details
method. This method should be named details
.
return response | ||
end | ||
|
||
def send_message(channel, text) |
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.
Well done
end | ||
|
||
def details | ||
["name", "slack_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 just returns an array with the strings "name" and "slack_id" in it... This isn't useful data. I would suggest:
def details
return "name: #{name}\nID: #{slack_id}"
end
end | ||
|
||
def select_user(name_or_id) | ||
users.each do |user| |
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 can use users.find
here to simplify it.
return @selection | ||
end | ||
|
||
def select_channel(name_or_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.
Do you notice how this and select_user
are almost identical... that's a good sign you can dry it up with a helper method.
@@ -0,0 +1,14 @@ | |||
require_relative "test_helper" | |||
|
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.
Incomplete testing here
user = Slack::User.list | ||
|
||
expect(user).must_be_kind_of(Array) | ||
# check at index that its an instance of user |
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.
Just need to verify that all elements are instances of User.
end | ||
|
||
describe "Show details method" do | ||
it "returns details" 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.
incomplete tests
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions
self.get
method to access data from the API and we're using oursend_message
methods to post messages to Slack.