Explorar el Código

Additional tests for TimelogController and added missing i18n string.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8263 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/1.4.0
Jean-Philippe Lang hace 12 años
padre
commit
b4af45537a

+ 1
- 0
config/locales/bg.yml Ver fichero

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

+ 1
- 0
config/locales/bs.yml Ver fichero

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

+ 1
- 0
config/locales/ca.yml Ver fichero

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

+ 1
- 0
config/locales/cs.yml Ver fichero

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

+ 1
- 0
config/locales/da.yml Ver fichero

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

+ 1
- 0
config/locales/de.yml Ver fichero

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

+ 1
- 0
config/locales/el.yml Ver fichero

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

+ 1
- 0
config/locales/en-GB.yml Ver fichero

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

+ 1
- 0
config/locales/en.yml Ver fichero

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

+ 1
- 0
config/locales/es.yml Ver fichero

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

+ 1
- 0
config/locales/eu.yml Ver fichero

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

+ 1
- 0
config/locales/fa.yml Ver fichero

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

+ 1
- 0
config/locales/fi.yml Ver fichero

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

+ 1
- 0
config/locales/fr.yml Ver fichero

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

+ 1
- 0
config/locales/gl.yml Ver fichero

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

+ 1
- 0
config/locales/he.yml Ver fichero

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

+ 1
- 0
config/locales/hr.yml Ver fichero

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

+ 1
- 0
config/locales/hu.yml Ver fichero

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

+ 1
- 0
config/locales/id.yml Ver fichero

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

+ 1
- 0
config/locales/it.yml Ver fichero

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

+ 1
- 0
config/locales/ja.yml Ver fichero

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

+ 1
- 0
config/locales/ko.yml Ver fichero

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

+ 1
- 0
config/locales/lt.yml Ver fichero

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

+ 1
- 0
config/locales/lv.yml Ver fichero

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

+ 1
- 0
config/locales/mk.yml Ver fichero

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

+ 1
- 0
config/locales/mn.yml Ver fichero

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

+ 1
- 0
config/locales/nl.yml Ver fichero

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

+ 1
- 0
config/locales/no.yml Ver fichero

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

+ 1
- 0
config/locales/pl.yml Ver fichero

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

+ 1
- 0
config/locales/pt-BR.yml Ver fichero

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

+ 1
- 0
config/locales/pt.yml Ver fichero

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

+ 1
- 0
config/locales/ro.yml Ver fichero

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

+ 1
- 0
config/locales/ru.yml Ver fichero

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

+ 1
- 0
config/locales/sk.yml Ver fichero

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

+ 1
- 0
config/locales/sl.yml Ver fichero

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

+ 1
- 0
config/locales/sr-YU.yml Ver fichero

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

+ 1
- 0
config/locales/sr.yml Ver fichero

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

+ 1
- 0
config/locales/sv.yml Ver fichero

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

+ 1
- 0
config/locales/th.yml Ver fichero

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

+ 1
- 0
config/locales/tr.yml Ver fichero

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

+ 1
- 0
config/locales/uk.yml Ver fichero

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

+ 1
- 0
config/locales/vi.yml Ver fichero

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

+ 1
- 0
config/locales/zh-TW.yml Ver fichero

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

+ 1
- 0
config/locales/zh.yml Ver fichero

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

+ 78
- 0
test/functional/timelog_controller_test.rb Ver fichero

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

Cargando…
Cancelar
Guardar