From d6e66fa517e802979b8a5d4d15c68d539b62ef60 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 11 Jul 2012 15:35:21 +0200 Subject: [PATCH] fix failing cucumber tests fix data export view fix mentions of tag on tag page fix autocomplete for tags --- app/helpers/todos_helper.rb | 10 +++++----- app/views/data/index.en.html.erb | 10 +++++----- app/views/todos/_completed.html.erb | 2 +- app/views/todos/_deferred.html.erb | 2 +- app/views/todos/_hidden.html.erb | 2 +- config/cucumber.yml | 2 +- config/routes.rb | 5 ++++- features/edit_a_todo.feature | 1 - features/logging_in.feature | 2 +- features/project_edit.feature | 2 +- features/step_definitions/project_steps.rb | 6 +++++- features/step_definitions/todo_edit_steps.rb | 4 +++- features/view_done.feature | 1 - 13 files changed, 28 insertions(+), 21 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 917ced19..684193e1 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -18,8 +18,8 @@ module TodosHelper def remote_delete_menu_item(todo) # TODO: what is the current way to do mouseover with css? return link_to( - image_tag("delete_off.png", - :onmouseover => "this.src='#{path_to_image("delete_on.png")}'", + image_tag("delete_off.png", + :onmouseover => "this.src='#{path_to_image("delete_on.png")}'", :onmouseout => "this.src='#{path_to_image("delete_off.png")}'", :alt => t('todos.delete'), :align => "absmiddle")+" "+t('todos.delete'), {:controller => 'todos', :action => 'destroy', :id => todo.id}, @@ -64,8 +64,8 @@ module TodosHelper def image_tag_for_defer(days) # TODO: what is the current way to do mouseover with css? - image_tag("defer_#{days}_off.png", - :onmouseover => "this.src='#{path_to_image("defer_#{days}.png")}'", + image_tag("defer_#{days}_off.png", + :onmouseover => "this.src='#{path_to_image("defer_#{days}.png")}'", :onmouseout => "this.src='#{path_to_image("defer_#{days}_off.png")}'", :alt => t('todos.defer_x_days', :count => days), :align => "absmiddle")+" "+t('todos.defer_x_days', :count => days) end @@ -143,7 +143,7 @@ module TodosHelper end def tag_span (tag, mobile=false) - content_tag(:span, :class => "tag #{tag.name.gsub(' ','-')}") { link_to(tag.name, tag_path(tag.name, :format => mobile ? :m : :html)) } + content_tag(:span, :class => "tag #{tag.name.gsub(' ','-')}") { link_to(tag.name, tag_path(tag.name, :format => mobile ? :m : nil)) } end def tag_list(todo=@todo, mobile=false) diff --git a/app/views/data/index.en.html.erb b/app/views/data/index.en.html.erb index 414526a1..59052c3f 100644 --- a/app/views/data/index.en.html.erb +++ b/app/views/data/index.en.html.erb @@ -17,20 +17,20 @@ YAML file containing all your actions, contexts, projects, tags and notes - <%= link_to "YAML file", :controller => 'data', :action => 'yaml_export' %> + <%= link_to "YAML file", data_yaml_export_path %> CSV file containing all of your actions, with named contexts and projects - <%= link_to "CSV file (actions, contexts and projects)", :controller => 'data', :action => 'csv_actions' %> + <%= link_to "CSV file (actions, contexts and projects)", data_csv_actions_path %> CSV file containing all your notes - <%= link_to "CSV file (notes only)", :controller => 'data', :action => 'csv_notes' %> + <%= link_to "CSV file (notes only)", data_csv_notes_path %> XML file containing all your actions, contexts, projects, tags and notes - <%= link_to "XML file (actions only)", :controller => 'data', :action => 'xml_export' %> + <%= link_to "XML file (actions only)", data_xml_export_path %> - + diff --git a/app/views/todos/_completed.html.erb b/app/views/todos/_completed.html.erb index b1a79823..354a03f6 100644 --- a/app/views/todos/_completed.html.erb +++ b/app/views/todos/_completed.html.erb @@ -8,7 +8,7 @@ <% if collapsible %> <%= image_tag("collapse.png") %> <% end %> - <%= t('todos.completed_actions') %> <%= suffix %> + <%= t('todos.completed_actions') %> <%= raw suffix %>
diff --git a/app/views/todos/_deferred.html.erb b/app/views/todos/_deferred.html.erb index fa060e64..cab8f027 100644 --- a/app/views/todos/_deferred.html.erb +++ b/app/views/todos/_deferred.html.erb @@ -3,7 +3,7 @@ <% if collapsible %> <%= image_tag("collapse.png") %> <% end %> - <%= t('todos.deferred_pending_actions') %> <%= append_descriptor ? append_descriptor : '' %> + <%= t('todos.deferred_pending_actions') %> <%= raw(append_descriptor ? append_descriptor : '') %>
diff --git a/app/views/todos/_hidden.html.erb b/app/views/todos/_hidden.html.erb index cedfb298..4f7e581f 100644 --- a/app/views/todos/_hidden.html.erb +++ b/app/views/todos/_hidden.html.erb @@ -3,7 +3,7 @@ <% if collapsible %> <%= image_tag("collapse.png") %> <% end %> - <%= t('todos.hidden_actions') %> <%= append_descriptor ? append_descriptor : '' %> + <%= t('todos.hidden_actions') %> <%= raw(append_descriptor ? append_descriptor : '') %>
diff --git a/config/cucumber.yml b/config/cucumber.yml index 645eff4e..710cc9ea 100644 --- a/config/cucumber.yml +++ b/config/cucumber.yml @@ -4,5 +4,5 @@ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'pr std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip" %> default: <%= std_opts %> features -wip: --tags @wip:10 --wip features +wip: --tags @wip:15 --wip features rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/config/routes.rb b/config/routes.rb index 3dc52191..1093319e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -71,6 +71,8 @@ Tracksapp::Application.routes.draw do match 'data' => "data#index" match 'data/csv_notes' => 'data#csv_notes' match 'data/yaml_export' => 'data#yaml_export' + match 'data/xml_export' => 'data#xml_export' + match 'data/csv_actions' => 'data#csv_actions' match 'integrations' => "integrations#index" match 'integrations/rest_api' => "integrations#rest_api", :as => 'rest_api_docs' @@ -151,6 +153,8 @@ Tracksapp::Application.routes.draw do end end match 'todos/tag/:name' => 'todos#tag', :as => :tag + match 'tags.autocomplete' => "todos#tags", :format => 'autocomplete' + match 'todos/done/tag/:name' => "todos#done_tag", :as => :done_tag match 'todos/all_done/tag/:name' => "todos#all_done_tag", :as => :all_done_tag match 'auto_complete_for_predecessor' => 'todos#auto_complete_for_predecessor' @@ -230,7 +234,6 @@ Tracksapp::Application.routes.draw do # todos.done_tag 'todos/done/tag/:name', :action => "done_tag" # todos.all_done_tag 'todos/all_done/tag/:name', :action => "all_done_tag" # - # todos.tags 'tags.autocomplete', :action => "tags", :format => 'autocomplete' # todos.auto_complete_for_predecessor 'auto_complete_for_predecessor', :action => 'auto_complete_for_predecessor' # # todos.calendar 'calendar.ics', :action => "calendar", :format => 'ics' diff --git a/features/edit_a_todo.feature b/features/edit_a_todo.feature index eeb5f05f..b68bcdaf 100644 --- a/features/edit_a_todo.feature +++ b/features/edit_a_todo.feature @@ -248,7 +248,6 @@ Feature: Edit a next action from every page Then I should see the todo "bla" And I should see the todo "bli" - @wip Scenario: Clicking a tag of a todo will go to that tag page Given I have a todo "tag you are it" in context "@tags" with tags "taga, tagb" When I go to the home page diff --git a/features/logging_in.feature b/features/logging_in.feature index fb22579b..2f2e86e3 100644 --- a/features/logging_in.feature +++ b/features/logging_in.feature @@ -50,7 +50,7 @@ Feature: Existing user logging in | "top secret" project for user "testuser" | "top secret" project for user "testuser" | Logout (Test User) | | context page for "@secret location" for user "testuser" | context page for "@secret location" for user "testuser" | Logout (Test User) | - @javascript @wip + @javascript Scenario: When session expires, you should be logged out When I go to the login page And I submit the login form as user "testuser" with password "secret" diff --git a/features/project_edit.feature b/features/project_edit.feature index b5c3b8c7..1420db21 100644 --- a/features/project_edit.feature +++ b/features/project_edit.feature @@ -101,7 +101,7 @@ Feature: Edit a project And I cancel adding a note to the project Then the form for adding a note should not be visible - @javascript @wip + @javascript Scenario: Long notes in a project are shown cut off Given I have a project called "test" When I go to the "test" project diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index a70f0b53..ab3ccc56 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -198,7 +198,11 @@ When /^I add a note "([^"]*)" to the project$/ do |note_body| page.should have_css "div.widgets button#submit_note" fill_in "note[body]", :with => note_body click_button "Add note" - page.should_not have_css "div.widgets button#submit_note" + + submit_button = "div.widgets button#submit_note" + elem = find(submit_button) + elem.should_not be_nil # form is hidden + elem.should_not be_visible end When /^I click on the first note icon$/ do diff --git a/features/step_definitions/todo_edit_steps.rb b/features/step_definitions/todo_edit_steps.rb index 6086892c..3d905495 100644 --- a/features/step_definitions/todo_edit_steps.rb +++ b/features/step_definitions/todo_edit_steps.rb @@ -173,7 +173,9 @@ When /^I edit the tags of "([^"]*)" to "([^"]*)"$/ do |action_description, tags| todo.should_not be_nil open_edit_form_for(todo) - fill_in "todo_tag_list", :with => tags + within "form#form_todo_#{todo.id}" do + fill_in "tag_list", :with => tags + end submit_edit_todo_form(todo) end diff --git a/features/view_done.feature b/features/view_done.feature index f74bc346..4834d212 100644 --- a/features/view_done.feature +++ b/features/view_done.feature @@ -181,7 +181,6 @@ Feature: Show done When I go to the projects page Then I should see "completed project" - @wip Scenario Outline: All pages are internationalized Given I set the locale to "" When I go to the