Skip to content

Conversation

@dnsrocha
Copy link

@dnsrocha dnsrocha commented Nov 3, 2020

Task List

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe in your own words what the Model is doing in Rails Adding database records, updating, removing and/or finding data (CRUD).
Describe in your own words what the Controller is doing in Rails The controller makes sense out of a request made in the rails application and produces appropriate output (it makes the model data available to the view).
Describe in your own words what the View is doing in Rails The view is the part that is actually shown to the user (the actual webpage).
Describe an edge-case controller test you wrote Will redirect to the root page given an invalid id.
What is the purpose of using strong params? (i.e. the params method in the controller) Strong params prevents assigning request parameters to objects unless they have been explicitly permitted.
How are Rails migrations related to Rails models? Rails migrations are related to the Table itself such as adding a new column or creating a new Table. Models are the data or rows in the Table.
Describe one area of Rails that are still unclear on Testing for rails still need some clarification to me.

@dnsrocha
Copy link
Author

dnsrocha commented Nov 3, 2020

I made a mistake when doing my first pull request 2 days ago. I did it to AdaGold, and it can be seen in this link:

AdaGold#32

Copy link

@dHelmgren dHelmgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task List

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
At least 6 commits with meaningful commit messages ✔️
Routes follow RESTful conventions ✔️
Uses named routes (like _path) ✔️
Creates Models and migrations ✔️
Creates styled views no styling!
Handles errors like nonexistant tasks ✔️
Uses form_with to render forms in Rails ✔️

Functional Requirements/Manual Testing

Functional Requirement yes/no
Successfully handles index & show ✔️
index & show tests pass ✔️
Successfully handles: New, Create ✔️
New, Create tests pass ✔️
Successfully handles: Edit, Update ✔️
Edit, Update tests pass with valid & invalid task ids ✔️
Successfully handles: Destroy, Task Complete ✔️
Tests for Destroy & Task Complete include tests for valid and invalid task ids missing

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 5+ in Code Review && 6+ in Functional Requirements ✔️
Yellow (Approaches Standards) 3+ in Code Review && 5+ in Functional Requirements, or the instructor judges that this project needs special attention
Red (Not at Standard) 0-2 in Code Review or 0-4 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging, or the instructor judges that this project needs special attention

<li>
<div>
<%= link_to task.name, task_path(task) %>
<%= button_to "Mark complete", task_complete_path(task), method: :patch%>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might use the data from the task to optionally include this button. :)

Comment on lines +161 to +182
Task.create(name: "Watch The Mandalorian", description: "Watch recap from last season first", completed_at: nil)
task_hash = {
task: {
name: "new task",
description: "new task description",
completed_at: Time.now.to_s,
},
}
task = Task.first

# Act-Assert
expect {
patch task_path(task.id), params: task_hash
}.must_differ "Task.count", 0

new_task = Task.find_by(name: task_hash[:task][:name])
expect(new_task.description).must_equal task_hash[:task][:description]
expect(new_task.completed_at).must_equal task_hash[:task][:completed_at]

must_respond_with :redirect
must_redirect_to task_path(new_task.id)
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the task doesn't exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants