Commit 398c4f34 authored by jplang's avatar jplang

Additional tests for TimelogController and added missing i18n string.

git-svn-id: https://svn.redmine.org/redmine/trunk@8263 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent e1ee5288
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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."
......
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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.
......
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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}."
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment