first pass of all tests done

This commit is contained in:
Reinier Balt 2012-05-18 15:33:47 +02:00
parent 598891c1d3
commit 5e477a4d25
16 changed files with 46 additions and 23 deletions

View file

@ -189,26 +189,26 @@ class ProjectsController < ApplicationController
update_state_counts
init_data_for_sidebar
template = 'projects/update.js.erb'
template = 'projects/update'
# TODO: are these params ever set? or is this dead code?
elsif boolean_param('update_status')
template = 'projects/update_status.js.rjs'
template = 'projects/update_status'
elsif boolean_param('update_default_context')
@initial_context_name = @project.default_context.name
template = 'projects/update_default_context.js.rjs'
template = 'projects/update_default_context'
elsif boolean_param('update_default_tags')
template = 'projects/update_default_tags.js.rjs'
template = 'projects/update_default_tags'
elsif boolean_param('update_project_name')
@projects = current_user.projects
template = 'projects/update_project_name.js.rjs'
template = 'projects/update_project_name'
else
render :text => success_text || 'Success'
return
end
else
init_data_for_sidebar
template = 'projects/update.js.erb'
template = 'projects/update'
end
respond_to do |format|

View file

@ -30,8 +30,8 @@ class StatsController < ApplicationController
# convert to array and fill in non-existing months
@actions_done_last12months_array = convert_to_months_from_today_array(@actions_done_last12months, 13, :completed_at)
@actions_created_last12months_array = convert_to_months_from_today_array(@actions_created_last12months, 13, :created_at)
@actions_done_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_done_last12monthsPlus3, 13, :completed_at)
@actions_created_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_created_last12monthsPlus3, 15, :created_at)
@actions_done_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_done_last12monthsPlus3, 16, :completed_at)
@actions_created_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_created_last12monthsPlus3, 16, :created_at)
# find max for graph in both arrays
@max = [@actions_done_last12months_array.max, @actions_created_last12months_array.max].max
@ -446,8 +446,8 @@ class StatsController < ApplicationController
@seconds_per_day = 60*60*24
# define cut_off date and discard the time for a month, 3 months and a year
@cut_off_year = 13.months.ago.beginning_of_day
@cut_off_year_plus3 = 16.months.ago.beginning_of_day
@cut_off_year = 12.months.ago.beginning_of_day
@cut_off_year_plus3 = 15.months.ago.beginning_of_day
@cut_off_month = 1.month.ago.beginning_of_day
@cut_off_3months = 3.months.ago.beginning_of_day
end

View file

@ -26,7 +26,7 @@ module RecurringTodosHelper
edit_recurring_todo_path(@recurring_todo),
:class => "icon edit_icon", :id => "link_edit_recurring_todo_#{@recurring_todo.id}")
else
str = '<a class="icon">' + image_tag("blank.png") + "</a> "
str = content_tag(:a, image_tag("blank.png"), :class => "icon")
end
str
end

View file

@ -10,7 +10,7 @@
<%= t('common.last' ) unless ( ['review','stalled','blocked','current'].include?(state) )%>
<%= t('states.'+state+'_plural' )%>
<%= t('common.projects') %><%= total_count==-1 ? "" : " ("+link_to(t('common.show_all'), done_projects_path)+")"%>
<%= t('common.projects') %><%= total_count==-1 ? "" : " (#{link_to(t('common.show_all'), done_projects_path)})".html_safe%>
</h2>
<% unless suppress_sort_menu %>

View file

@ -87,7 +87,7 @@ function html_for_project_listing() {
}
function html_for_sidebar() {
return "<%= source_view_is(:project) ? escape_javascript(render(:file => 'sidebar/sidebar.html.erb')) : "" %>";
return "<%= source_view_is(:project) ? escape_javascript(render(:file => 'sidebar/sidebar')) : "" %>";
}
function html_for_project_settings() {

View file

@ -1,2 +1,2 @@
<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => :actions_done_lastyears_data)} -%>
<%= t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), {:controller => "stats", :action => "index"})) %>
<%= raw t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), stats_path)) %>

View file

@ -36,7 +36,7 @@
<% if @last_completed_recurring_todos.empty? -%>
<div class="message"><p><%= t('projects.no_last_completed_recurring_todos') %></p></div>
<% else -%>
<%= render :partial => '/recurring_todos/recurring_todo', :collection => @last_completed_recurring_todos %>
<%= render :partial => @last_completed_recurring_todos %>
<% end -%>
</div>

View file

@ -1,12 +1,12 @@
<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => @chart_name)} -%>
<br/>
<p>
<%= t('stats.click_to_update_actions') %> <%= t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), {:controller => "stats", :action => "index"})) %>
<%= t('stats.click_to_update_actions') %> <%= raw t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), stats_path)) %>
<%
unless @further
-%>
<%= t('stats.click_to_show_actions_from_week',
:link => link_to("here", {:controller => "stats", :action => "show_selected_actions_from_chart", :id=>"#{params[:id]}_end", :index => params[:index]}),
<%= raw t('stats.click_to_show_actions_from_week',
:link => link_to("here", show_actions_from_chart_path(:id=>"#{params[:id]}_end", :index => params[:index])),
:week => params[:index])
-%>
<%

View file

@ -26,6 +26,6 @@
<% end -%>
</div>
<p><%= t('todos.see_all_completed', :link => link_to(t("todos.all_completed_here"), determine_all_done_path)) %></p>
<p><%= raw t('todos.see_all_completed', :link => link_to(t("todos.all_completed_here"), determine_all_done_path)) %></p>
</div>

View file

@ -66,19 +66,41 @@ Tracksapp::Application.routes.draw do
match "tickler" => "todos#list_deferred"
match 'review' => "projects#review"
match 'calendar' => "todos#calendar"
match 'stats' => 'stats#index'
match 'data' => "data#index"
match 'done' => "stats#done", :as => 'done_overview'
match 'integrations' => "integrations#index"
match 'integrations/rest_api' => "integrations#rest_api", :as => 'rest_api_docs'
match 'integrations/cloudmailin' => 'integrations#cloudmailin'
match 'integrations/search_plugin.xml' => "integrations#search_plugin", :as => 'search_plugin'
match 'integrations/google_gadget.xml' => 'integrations#google_gadget', :as => 'google_gadget'
match 'integrations/get_applescript1.js' => 'integrations#get_applescript1'
match 'integrations/get_applescript2.js' => 'integrations#get_applescript2'
match 'integrations/get_quicksilver_applescript.js' => 'integrations#get_quicksilver_applescript'
match 'preferences' => "preferences#index"
match 'preferences/render_date_format' => "preferences#render_date_format"
match 'feeds' => "feedlist#index", :as => 'feeds'
match 'feedlist/get_feeds_for_context' => 'feedlist#get_feeds_for_context'
match 'feedlist/get_feeds_for_project' => 'feedlist#get_feeds_for_project'
match 'data' => "data#index"
match 'stats' => 'stats#index'
match 'stats/actions_done_last12months_data' => 'stats#actions_done_last12months_data'
match 'stats/actions_done_last_years' => 'stats#actions_done_last_years'
match 'stats/actions_done_lastyears_data' => 'stats#actions_done_lastyears_data'
match 'stats/actions_done_last30days_data' => 'stats#actions_done_last30days_data'
match 'stats/actions_completion_time_data' => 'stats#actions_completion_time_data'
match 'stats/actions_running_time_data' => 'stats#actions_running_time_data'
match 'stats/actions_visible_running_time_data' => 'stats#actions_visible_running_time_data'
match 'stats/actions_open_per_week_data' => 'stats#actions_open_per_week_data'
match 'stats/context_total_actions_data' => 'stats#context_total_actions_data'
match 'stats/context_running_actions_data' => 'stats#context_running_actions_data'
match 'stats/actions_day_of_week_all_data' => 'stats#actions_day_of_week_all_data'
match 'stats/actions_day_of_week_30days_data' => 'stats#actions_day_of_week_30days_data'
match 'stats/actions_time_of_day_all_data' => 'stats#actions_time_of_day_all_data'
match 'stats/actions_time_of_day_30days_data' => 'stats#actions_time_of_day_30days_data'
match 'stats/show_selected_actions_from_chart/:id' => 'stats#show_selected_actions_from_chart', :as => 'show_actions_from_chart'
resources :contexts do
member do

View file

@ -108,7 +108,7 @@ Then /^I should see the page selector$/ do
end
Then /^the page should be "([^"]*)"$/ do |page_number|
page.find(:xpath, ".//span[@class='current']").text.should == page_number
page.find(:xpath, ".//em[@class='current']").text.should == page_number
end
Then /^the project field of the new todo form should contain "([^"]*)"$/ do |project_name|

View file

@ -113,7 +113,7 @@ Feature: Show done
Then I should be on the done recurring todos page
And the page should be "2"
@javascript @wip
@javascript
Scenario: I can toggle a done recurring todo active from done page
Given I have a completed repeat pattern "test pattern"
When I go to the done recurring todos page
@ -181,6 +181,7 @@ 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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B