-
Notifications
You must be signed in to change notification settings - Fork 49
Ports - Kasey #40
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 - Kasey #40
Conversation
Task ListWhat We're Looking For
|
| @@ -0,0 +1,27 @@ | |||
| <% Time.zone = "Pacific Time (US & Canada)" %> | |||
| <h1>Tasks#index</h1> | |||
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 kind of placeholder code really should be deleted
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>TaskList</title> |
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.
It would be nice to have some navigation links on the app here to create tasks, and see the list of tasks.
| must_redirect_to tasks_path | ||
| end | ||
|
|
||
| it "redirects to task page" 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 also need a test for what happens if you try to destroy a nonexistant Task
| patch mark_complete_path(test_task.id) | ||
| test_task.reload | ||
|
|
||
| expect(test_task.completion).must_equal true |
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 what happens on the next toggle.
|
|
||
| <p><%= @task.description %></p> | ||
|
|
||
| <p><%= @task %></p> |
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 shouldn't output the task object, it ends up putting something like this on the browser: #<Task:0x00007fa922bdf290>
|
|
||
| <h2>Tasks Completed</h2> | ||
| <% @tasks.each do |task| %> | ||
| <% if task.completion == true %> |
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.
So no way to mark a task incomplete after it's marked complete?
| <p><%= @task.description %></p> | ||
|
|
||
| <p><%= @task %></p> | ||
| <%= button_to "click me to delete #{@task.title}", task_path, method: :delete %> No newline at end of file |
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 really don't need the separate page for deleting, instead you can do something like this:
<%= button_to "Delete #{@task.title}", task_path, method: :delete, data: { confirm: "Are you sure you want to delete the #{@task.title}?"}
|
|
||
| resources :tasks | ||
|
|
||
| get "tasks/:id/delete", to: "tasks#delete", as: "delete_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.
Just to note, this isn't a RESTful route.
| resources :tasks | ||
|
|
||
| get "tasks/:id/delete", to: "tasks#delete", as: "delete_task" | ||
| get "/tasks/:id/complete", to: "tasks#toggle_completion", as: "mark_complete" |
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 other route isn't being used.
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions