diff --git a/config/locales/bg.yml b/config/locales/bg.yml index f5664f4..9fd5280 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1004,3 +1004,4 @@ bg: description_date_range_interval: Изберете диапазон чрез задаване на начална и крайна дати description_date_from: Въведете начална дата description_date_to: Въведете крайна дата + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/bs.yml b/config/locales/bs.yml index a3df656..4af6b10 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -1020,3 +1020,4 @@ bs: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 06db085..ceb9e77 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1009,3 +1009,4 @@ ca: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 7de2e23..0dba900 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1010,3 +1010,4 @@ cs: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/da.yml b/config/locales/da.yml index 00b74fe..d884cfb 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1023,3 +1023,4 @@ da: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/de.yml b/config/locales/de.yml index ea60e80..9fcd469 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1027,3 +1027,4 @@ de: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/el.yml b/config/locales/el.yml index 0fe05a1..e8aa92c 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -1006,3 +1006,4 @@ el: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 9e43726..ba775dc 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -1009,3 +1009,4 @@ en-GB: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/en.yml b/config/locales/en.yml index ba8d689..88cc1a6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -162,6 +162,7 @@ en: notice_feeds_access_key_reseted: Your RSS access key was reset. notice_api_access_key_reseted: Your API access key was reset. notice_failed_to_save_issues: "Failed to save %{count} issue(s) on %{total} selected: %{ids}." + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." notice_failed_to_save_members: "Failed to save member(s): %{errors}." notice_no_issue_selected: "No issue is selected! Please, check the issues you want to edit." notice_account_pending: "Your account was created and is now pending administrator approval." diff --git a/config/locales/es.yml b/config/locales/es.yml index c61bb8f..426ede5 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1043,3 +1043,4 @@ es: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 7fe7d1a..f92ab5d 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -1010,3 +1010,4 @@ eu: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 5b1e5a2..ec9b594 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -1009,3 +1009,4 @@ fa: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 89ad071..c8cb62a 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1027,3 +1027,4 @@ fi: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 9d43ac0..024a35c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -178,6 +178,7 @@ fr: notice_email_error: "Erreur lors de l'envoi de l'email (%{value})" notice_feeds_access_key_reseted: "Votre clé d'accès aux flux RSS a été réinitialisée." notice_failed_to_save_issues: "%{count} demande(s) sur les %{total} sélectionnées n'ont pas pu être mise(s) à jour : %{ids}." + notice_failed_to_save_time_entries: "%{count} temps passé(s) sur les %{total} sélectionnés n'ont pas pu être mis à jour: %{ids}." notice_no_issue_selected: "Aucune demande sélectionnée ! Cochez les demandes que vous voulez mettre à jour." notice_account_pending: "Votre compte a été créé et attend l'approbation de l'administrateur." notice_default_data_loaded: Paramétrage par défaut chargé avec succès. diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 1d8d280..a7df8f0 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1018,3 +1018,4 @@ gl: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/he.yml b/config/locales/he.yml index faf1a05..10d367d 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1011,3 +1011,4 @@ he: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/hr.yml b/config/locales/hr.yml index 8ddd13e..c01d4f5 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -1013,3 +1013,4 @@ hr: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/hu.yml b/config/locales/hu.yml index f43e7b0..ab9ceae 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1025,3 +1025,4 @@ button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/id.yml b/config/locales/id.yml index 23b92a7..81fc6e6 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -1014,3 +1014,4 @@ id: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/it.yml b/config/locales/it.yml index 6ff2a49..c37f408 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1007,3 +1007,4 @@ it: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 09698aa..90e106c 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1036,3 +1036,4 @@ ja: button_export: エクスポート label_export_options: "%{export_format} エクスポート設定" error_attachment_too_big: このファイルはアップロードできません。添付ファイルサイズの上限(%{max_size})を超えています。 + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 15e398f..324785e 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1058,3 +1058,4 @@ ko: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 9c2e8b2..4ac1fba 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -1066,3 +1066,4 @@ lt: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 18fc69f..fcc1034 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1001,3 +1001,4 @@ lv: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/mk.yml b/config/locales/mk.yml index 5934541..8d6e7b7 100644 --- a/config/locales/mk.yml +++ b/config/locales/mk.yml @@ -1006,3 +1006,4 @@ mk: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/mn.yml b/config/locales/mn.yml index 577f058..75aa863 100644 --- a/config/locales/mn.yml +++ b/config/locales/mn.yml @@ -1007,3 +1007,4 @@ mn: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 5fb7848..adc712e 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -988,3 +988,4 @@ nl: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/no.yml b/config/locales/no.yml index a5b36bd..d71810c 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -996,3 +996,4 @@ button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/pl.yml b/config/locales/pl.yml index f255c9b..f0698df 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1023,3 +1023,4 @@ pl: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 1115fdd..8078d70 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1027,3 +1027,4 @@ pt-BR: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 6faa0f1..8489f10 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -1011,3 +1011,4 @@ pt: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/ro.yml b/config/locales/ro.yml index a742c63..6049164 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -999,3 +999,4 @@ ro: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/ru.yml b/config/locales/ru.yml index f82f58f..3934f4c 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1119,3 +1119,4 @@ ru: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 00922f0..117ce2b 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -1001,3 +1001,4 @@ sk: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 518db6d..781cd9c 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1006,3 +1006,4 @@ sl: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/sr-YU.yml b/config/locales/sr-YU.yml index c3e05e8..5bba32d 100644 --- a/config/locales/sr-YU.yml +++ b/config/locales/sr-YU.yml @@ -1006,3 +1006,4 @@ sr-YU: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 2c9b0b3..f4a11fe 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1007,3 +1007,4 @@ sr: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/sv.yml b/config/locales/sv.yml index ebd1c36..4a8ee2c 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1047,3 +1047,4 @@ sv: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/th.yml b/config/locales/th.yml index 70468d4..befb889 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -1003,3 +1003,4 @@ th: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/tr.yml b/config/locales/tr.yml index e167eb4..e297eec 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -1025,3 +1025,4 @@ tr: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 81d0498..b1aff79 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1002,3 +1002,4 @@ uk: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/vi.yml b/config/locales/vi.yml index fb0a9fb..d154db9 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1057,3 +1057,4 @@ vi: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index b435fc4..a5573bc 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1086,3 +1086,4 @@ description_date_range_interval: 選擇起始與結束日期以設定範圍區間 description_date_from: 輸入起始日期 description_date_to: 輸入結束日期 + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 0a9c57f..d7373d9 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1008,3 +1008,4 @@ zh: button_export: Export label_export_options: "%{export_format} export options" error_attachment_too_big: This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size}) + notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}." diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index feb5374..7a788ae 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -175,6 +175,14 @@ class TimelogControllerTest < ActionController::TestCase assert_equal [9, 9], TimeEntry.find_all_by_id([1, 2]).collect {|i| i.activity_id} end + def test_bulk_update_with_failure + @request.session[:user_id] = 2 + post :bulk_update, :ids => [1, 2], :time_entry => { :hours => 'A'} + + assert_response 302 + assert_match /Failed to save 2 time entrie/, flash[:error] + end + def test_bulk_update_on_different_projects @request.session[:user_id] = 2 # makes user a manager on the other project @@ -312,6 +320,76 @@ class TimelogControllerTest < ActionController::TestCase :attributes => {:action => "/projects/ecookbook/time_entries", :id => 'query_form'} end + def test_index_today + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => 'today' + assert_equal '2011-12-15'.to_date, assigns(:from) + assert_equal '2011-12-15'.to_date, assigns(:to) + end + + def test_index_yesterday + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => 'yesterday' + assert_equal '2011-12-14'.to_date, assigns(:from) + assert_equal '2011-12-14'.to_date, assigns(:to) + end + + def test_index_current_week + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => 'current_week' + assert_equal '2011-12-12'.to_date, assigns(:from) + assert_equal '2011-12-18'.to_date, assigns(:to) + end + + def test_index_last_week + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => 'current_week' + assert_equal '2011-12-05'.to_date, assigns(:from) + assert_equal '2011-12-11'.to_date, assigns(:to) + end + + def test_index_last_week + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => 'last_week' + assert_equal '2011-12-05'.to_date, assigns(:from) + assert_equal '2011-12-11'.to_date, assigns(:to) + end + + def test_index_7_days + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => '7_days' + assert_equal '2011-12-08'.to_date, assigns(:from) + assert_equal '2011-12-15'.to_date, assigns(:to) + end + + def test_index_current_month + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => 'current_month' + assert_equal '2011-12-01'.to_date, assigns(:from) + assert_equal '2011-12-31'.to_date, assigns(:to) + end + + def test_index_last_month + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => 'last_month' + assert_equal '2011-11-01'.to_date, assigns(:from) + assert_equal '2011-11-30'.to_date, assigns(:to) + end + + def test_index_30_days + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => '30_days' + assert_equal '2011-11-15'.to_date, assigns(:from) + assert_equal '2011-12-15'.to_date, assigns(:to) + end + + def test_index_current_year + Date.stubs(:today).returns('2011-12-15'.to_date) + get :index, :period => 'current_year' + assert_equal '2011-01-01'.to_date, assigns(:from) + assert_equal '2011-12-31'.to_date, assigns(:to) + end + def test_index_at_issue_level get :index, :issue_id => 1 assert_response :success