From 9ce4875bb07f317f75a8ac53ae24cb9b2faa4861 Mon Sep 17 00:00:00 2001 From: ChelseaC13 Date: Mon, 23 Mar 2020 23:13:59 -0700 Subject: [PATCH 1/4] just getting started. Will finish part one tomorrow. --- individual-reflection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/individual-reflection.md b/individual-reflection.md index 603cdeb..e69850c 100644 --- a/individual-reflection.md +++ b/individual-reflection.md @@ -9,7 +9,7 @@ Answer the following comprehension questions **within this file.** Write your an ### `GET` Request Review 1. Describe a GET request that your project makes, and the high-level description of what it does - - Answer: + - Answer:I think unlike many of my classmates I call my get method in the initialize of workspace. This made sense to me at the time because one of the first things I wanted was a list of users and channels. To get that list I used a self.get method and pased in the url. This method uses HTTParty.get to get a response form slack. If the request is no good we raise an error. 1. What is the verb of this request? - Answer: 1. What is the path (or the URL, or endpoint) of this request? From 20a3d90aca4bd876a29dfe7caf88d11d79db3e97 Mon Sep 17 00:00:00 2001 From: ChelseaC13 Date: Tue, 24 Mar 2020 14:00:32 -0700 Subject: [PATCH 2/4] Individual reflection questions done --- individual-reflection.md | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/individual-reflection.md b/individual-reflection.md index e69850c..bc45a21 100644 --- a/individual-reflection.md +++ b/individual-reflection.md @@ -11,46 +11,53 @@ Answer the following comprehension questions **within this file.** Write your an 1. Describe a GET request that your project makes, and the high-level description of what it does - Answer:I think unlike many of my classmates I call my get method in the initialize of workspace. This made sense to me at the time because one of the first things I wanted was a list of users and channels. To get that list I used a self.get method and pased in the url. This method uses HTTParty.get to get a response form slack. If the request is no good we raise an error. 1. What is the verb of this request? - - Answer: + - Answer: GET 1. What is the path (or the URL, or endpoint) of this request? - - Answer: + - Answer: There are 2 one for users: api/users and one for channels: api/conversations 1. What are the query params (the additional data sent with the request, besides the verb and the path)? - - Answer: + - Answer: Just the token 1. What is the syntax used to make this request? (Copy and paste a code snippet here) - Answer: ```ruby # Copy and paste your answer below this comment - + response = HTTParty.get(url, query: {token: ENV['SLACK_TOKEN']}) # Copy and paste your answer above this comment ``` 1. What does the program do if the response comes back with a status code of 200? - - Answer: + - Answer: Returns the response. Meaning it works as we want it to. 1. What does the program do if the response does not come back with a status code of 200? - - Answer: + - Answer: raise SlackAPIError, "We encountered a problem: #{response["error"]}" ### `POST` Request Review If your project does not make a POST request, read through Wave 3 on the original Slack CLI, and research and answer questions 1, 2, 3, 4, 6, and 7. 1. Describe a POST request that your project makes, and the high-level description of what it does - - Answer: + - Answer: It posts a message to a recipient (selected channel or user). 1. What is the verb of this request? - - Answer: + - Answer: POST 1. What is the path (or the URL, or endpoint) of this request? - - Answer: + - Answer: api/chat 1. What are the query params (the additional data sent with the request, besides the verb and the path)? - - Answer: + - Answer: token, channel, and message 1. What is the syntax used to make this request? (Copy and paste a code snippet here) - Answer: ```ruby # Copy and paste your answer below this comment - + response = HTTParty.post( + "#{BASE_URL}", { + body: { + token: KEY, + channel: selected_recipient.id, + text: message + } + }) # Copy and paste your answer above this comment ``` 1. What does the program do if the response comes back with a status code of 200? - - Answer: + - Answer: It puts "message sent" 1. What does the program do if the response does not come back with a status code of 200? - - Answer: + - Answer: it looks like I did not so this, but it needs to raise an error. ## Request & Response Cycle @@ -62,11 +69,11 @@ There are two actors: Based on the project requirements, when Grace enters "list channels," 1. What is the request being made in the program? - - Answer: + - Answer: A GET request is sent via HTTParty to slack 1. Who is the client? - - Answer: + - Answer: The human user 1. Who is the server? - - Answer: + - Answer: Slack API ## Part 2: Optional Refactoring From bdffe5fbb9fc62ad9e081248ebd9f6b56637a10e Mon Sep 17 00:00:00 2001 From: Katie Date: Thu, 26 Mar 2020 13:14:14 -0700 Subject: [PATCH 3/4] testing to make sure I can commit to Chelsea's forked repo --- feedback.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feedback.md b/feedback.md index f90b999..65a39ea 100644 --- a/feedback.md +++ b/feedback.md @@ -1,7 +1,7 @@ # Feedback Rubric - Student Being Reviewed: -- Reviewer: +- Reviewer: Katie Vandervoort - Classroom: ## Manual App Testing From d55de414dc2166a6fe404c9c7a7f0da0c306214d Mon Sep 17 00:00:00 2001 From: Katie Date: Sun, 29 Mar 2020 17:47:52 -0700 Subject: [PATCH 4/4] filled out the feedback file --- feedback.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/feedback.md b/feedback.md index 65a39ea..453b783 100644 --- a/feedback.md +++ b/feedback.md @@ -1,8 +1,8 @@ # Feedback Rubric -- Student Being Reviewed: +- Student Being Reviewed: Chelsea Dallal - Reviewer: Katie Vandervoort -- Classroom: +- Classroom: Space ## Manual App Testing @@ -17,7 +17,7 @@ 1. Practices best practices working with APIs. (The .env is not checked into git, and no API token was directly used in the Ruby code without ENV.) - yes/no + yes @@ -26,7 +26,7 @@ 2. Practices error handling with APIs. (For all pieces of code that make an API call, it handles API requests that come back with errors/error status codes appropriately.) - yes/no + no @@ -35,7 +35,7 @@ 3. Implements inheritance and inheritance idioms. There is a Recipient class. User and Channel inherit from Recipient. In Recipient, there are appropriate methods defined that are used in both User and Channel. Some may be implemented. Some may be template methods. - yes/no + yes @@ -51,7 +51,7 @@ - yes/no + yes @@ -60,7 +60,7 @@ 5. Practices instance methods vs. class methods appropriately. (The methods to list all Channels or Users is a class method within those respective classes.) - yes/no + no @@ -70,7 +70,7 @@ 6. Practices best practices for testing. (The project has and uses VCR mocking when running tests, and can run offline.) - yes/no + yes @@ -80,7 +80,7 @@ 7. Practices writing tests. (The User, Channel, and Workspace classes have unit tests.) - yes/no + no @@ -90,7 +90,7 @@ 8. There are also tests for sending messages (the location of these tests may differ, but is likely in Recipient) - yes/no + no @@ -100,7 +100,7 @@ 9. Practices git with at least 15 small commits and meaningful commit messages - yes/no + no @@ -118,7 +118,7 @@ 1. As a user of the CLI program, I can list users and channels with the commands list users and list channels - yes/no + yes @@ -126,7 +126,7 @@ 2. As a user of the CLI program, I can select users and channels with the commands select user and select channel - yes/no + yes @@ -134,7 +134,7 @@ 3. As a user of the CLI program, I can show the details of a selected user or channel with the command details - yes/no + no @@ -142,7 +142,7 @@ 4. As a user of the CLI program, when I input something inappropriately, the program runs without crashing. Example commands to try are do_something, or select user followed by Mr. Fakename - yes/no + yes