diff --git a/app/views/todos/_done.rhtml b/app/views/todos/_done.rhtml index 2e3b7415..ef6e293d 100644 --- a/app/views/todos/_done.rhtml +++ b/app/views/todos/_done.rhtml @@ -1,22 +1,20 @@ -<% if done.completed_at %> - <%= image_tag( "done.png", :width=>"16", :height=>"16", :border=>"0") %> - <%= format_date( done.completed_at ) %> - <%= " " + sanitize(done.description) + " "%> + <% if done.completed_at %> + <%= image_tag( "done.png", :width=>"16", :height=>"16", :border=>"0") %> + <%= format_date( done.completed_at ) %> + <%= " " + sanitize(done.description) + " "%> - <% if done.project_id %> - <%= "(" + done.context['name'] + ", " + done.project['name'] + ")" %> - <% else %> - <%= "(" + done.context['name'] + ")" %> + <% if done.project_id %> + <%= "(" + done.context['name'] + ", " + done.project['name'] + ")" %> + <% else %> + <%= "(" + done.context['name'] + ")" %> + <% end %> + + <% if done.due %> + <%= " - " + t('todos.was_due_on_date', :date => format_date( done.due )) %> + <% end %> + + <%= collapsed_notes_image(done) if done.notes? %> + <% end %> - - <% if done.due %> - <%= " - " + t('todos.was_due_on_date', :date => format_date( done.due )) %> - <% end %> - - <% if done.notes? -%> - <%= render :partial => "todos/toggle_notes", :object => done %> - <% end -%> - -<% end %> diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb index a848fad8..a794b2f8 100644 --- a/features/step_definitions/todo_steps.rb +++ b/features/step_definitions/todo_steps.rb @@ -34,6 +34,14 @@ Given /^I have ([0-9]+) completed todos$/ do |count| end end +Given /^I have ([0-9]+) completed todos with a note$/ do |count| + context = @current_user.contexts.create!(:name => "context D") + count.to_i.downto 1 do |i| + todo = @current_user.todos.create!(:context_id => context.id, :description => "todo #{i}", :notes => "note #{i}") + todo.complete! + end +end + Given /^"(.*)" depends on "(.*)"$/ do |successor_name, predecessor_name| successor = Todo.find_by_description(successor_name) predecessor = Todo.find_by_description(predecessor_name) diff --git a/features/view_done.feature b/features/view_done.feature new file mode 100644 index 00000000..248d106f --- /dev/null +++ b/features/view_done.feature @@ -0,0 +1,15 @@ +Feature: Show done + In order to see what I have completed + As an user + I want see my done todos + + Background: + Given the following user record + | login | password | is_admin | + | testuser | secret | false | + + Scenario: Visit done page + Given I have logged in as "testuser" with password "secret" + And I have 1 completed todos with a note + When I go to the done page + Then I should see "Completed in the last 24 hours"