Open
Conversation
… user and channel classes
Hopefully this doesn't break things....
…sed if invalid query is sent to API
Merge branch 'master' of https://github.com/sophearychiv/slack-cli
slack.rbWhat We're Looking For
|
CheezItMan
reviewed
Mar 31, 2019
| @@ -0,0 +1,19 @@ | |||
| require "dotenv" | |||
| @status_text = status_text | ||
| @status_emoji = status_emoji | ||
| end | ||
|
|
| @topic = topic | ||
| @member_count = member_count | ||
| end | ||
|
|
| selected.send_message(message) | ||
| end | ||
|
|
||
| def tp_details_options |
There was a problem hiding this comment.
Instead of doing this in the Controller/Workspace, you could instead just return selected.details if you'd implemented that method in the User or Channel classes.
| private | ||
|
|
||
| def select(input, recipients) | ||
| recipients.each do |recipient| |
| @@ -0,0 +1,72 @@ | |||
| require_relative "test_helper" | |||
| # THIS IS MY COMMENT - Jessica | |||
| describe "send message" do | ||
| it "sends a valid message" do | ||
| VCR.use_cassette("slack_message") do | ||
| users = Slack::User.list |
There was a problem hiding this comment.
This seems to be testing User rather than recipient.
| end | ||
| end | ||
|
|
||
| it "raises an error if api sends back not okay" do |
There was a problem hiding this comment.
You should test this with both an invalid token and again with an empty message.
| end | ||
|
|
||
| def select_user(input) | ||
| select(input, users) |
| end | ||
|
|
||
| describe "send_message" do | ||
| it "sends a valid message" do |
There was a problem hiding this comment.
You should also test it with invalid messages.
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