fix failing cucumber tests

fix data export view
fix mentions of tag on tag page 
fix autocomplete for tags
This commit is contained in:
Reinier Balt 2012-07-11 15:35:21 +02:00
parent 4227aede6c
commit d6e66fa517
13 changed files with 28 additions and 21 deletions

View file

@ -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)

View file

@ -17,20 +17,20 @@
</tr>
<tr>
<td>YAML file containing all your actions, contexts, projects, tags and notes</td>
<td><%= link_to "YAML file", :controller => 'data', :action => 'yaml_export' %></td>
<td><%= link_to "YAML file", data_yaml_export_path %></td>
</tr>
<tr>
<td>CSV file containing all of your actions, with named contexts and projects</td>
<td><%= link_to "CSV file (actions, contexts and projects)", :controller => 'data', :action => 'csv_actions' %></td>
<td><%= link_to "CSV file (actions, contexts and projects)", data_csv_actions_path %></td>
</tr>
<tr>
<td>CSV file containing all your notes</td>
<td><%= link_to "CSV file (notes only)", :controller => 'data', :action => 'csv_notes' %></td>
<td><%= link_to "CSV file (notes only)", data_csv_notes_path %></td>
</tr>
<tr>
<td>XML file containing all your actions, contexts, projects, tags and notes</td>
<td><%= link_to "XML file (actions only)", :controller => 'data', :action => 'xml_export' %></td>
<td><%= link_to "XML file (actions only)", data_xml_export_path %></td>
</tr>
</table>
</table>
</div><!-- End of feeds -->
</div>

View file

@ -8,7 +8,7 @@
<% if collapsible %>
<a href="#" class="container_toggle" id="toggle_completed"><%= image_tag("collapse.png") %></a>
<% end %>
<%= t('todos.completed_actions') %> <%= suffix %>
<%= t('todos.completed_actions') %> <%= raw suffix %>
</h2>
<div id="completed_containeritems" class="items toggle_target">

View file

@ -3,7 +3,7 @@
<% if collapsible %>
<a href="#" class="container_toggle" id="toggle_deferred"><%= image_tag("collapse.png") %></a>
<% end %>
<%= t('todos.deferred_pending_actions') %> <%= append_descriptor ? append_descriptor : '' %>
<%= t('todos.deferred_pending_actions') %> <%= raw(append_descriptor ? append_descriptor : '') %>
</h2>
<div id="tickleritems" class="items toggle_target">

View file

@ -3,7 +3,7 @@
<% if collapsible %>
<a href="#" class="container_toggle" id="toggle_deferred"><%= image_tag("collapse.png") %></a>
<% end %>
<%= t('todos.hidden_actions') %> <%= append_descriptor ? append_descriptor : '' %>
<%= t('todos.hidden_actions') %> <%= raw(append_descriptor ? append_descriptor : '') %>
</h2>
<div id="hiddenitems" class="items toggle_target">

View file

@ -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

View file

@ -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'

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 "<locale>"
When I go to the <page>