-
Notifications
You must be signed in to change notification settings - Fork 49
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
Sockets - Shirley #26
base: master
Are you sure you want to change the base?
Conversation
Task ListWhat We're Looking For
|
@tasks = Task.all | ||
end | ||
|
||
def find_task |
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.
Great way to DRY up your code!
<% @tasks.each do |task| %> | ||
<li> | ||
<%= link_to ("♥ #{task.name}") , task_path(task), class: "task-name"%> | ||
<%= form_with model: @task, url: complete_task_path(task), method: :patch do |f|%> |
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 could also do this with:
<%= button_to "#{task.completion_date ? 'Unmark Complete' : 'Mark Complete'}", complete_task_path(task), method: patch, class: "button" %>
# successfully rediredts | ||
# Arrange | ||
# Act | ||
get edit_task_path(3456) |
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.
theoretically this could be a valid ID. Instead I suggest using -1 or "invalid id" as the ID for this test.
}, | ||
} | ||
|
||
patch task_path(1234), params: task_data |
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.
similar to the above
|
||
it "returns a 404 if the task does not exist" do | ||
# Arrange | ||
task_id = 123456 |
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.
ditto to the above
end | ||
|
||
# Complete for Wave 4 | ||
describe "toggle_complete" do | ||
# Your tests go here | ||
describe "complete_toggle" 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.
Nice work on this!
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions