-
Notifications
You must be signed in to change notification settings - Fork 49
Ports - Kim #31
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?
Ports - Kim #31
Conversation
… Tasks to the database, and added the show action to the Task Controller
…olumn to Tasks in order to pass test
Task ListWhat We're Looking For
|
|
|
||
| patch mark_complete_path(task.id) | ||
|
|
||
| expect(task.reload.completion_date).must_equal Date.today |
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 write a test that you can toggle the task back to incomplete after being marked complete.
| def create | ||
| task = Task.new(task_params) | ||
|
|
||
| if task.name == "" |
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, home-made validation!
|
|
||
| if task.nil? | ||
| head :not_found | ||
| elsif !task.completed |
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:
else
task.completed = !task.completed
task.completion_date = task.completed ? Date.today : nil
end
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions