-
Couldn't load subscription status.
- Fork 27
Ports - Sopheary & Jessica #16
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
… 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
|
| @@ -0,0 +1,19 @@ | |||
| require "dotenv" | |||
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 shouldn't be checked into git
| @status_text = status_text | ||
| @status_emoji = status_emoji | ||
| 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.
No details method?
| @topic = topic | ||
| @member_count = member_count | ||
| 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.
No details?
| selected.send_message(message) | ||
| end | ||
|
|
||
| def tp_details_options |
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.
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| |
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.
find would be a great option here.
| @@ -0,0 +1,72 @@ | |||
| require_relative "test_helper" | |||
| # THIS IS MY COMMENT - Jessica | |||
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.
And what a comment it is 😀
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should test this with both an invalid token and again with an empty message.
| end | ||
|
|
||
| def select_user(input) | ||
| select(input, users) |
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.
Really good work drying this up!
| end | ||
|
|
||
| describe "send_message" do | ||
| it "sends a valid message" 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.
You should also test it with invalid messages.
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions