OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
rewrites #format_date legacy specs
ulfertsc73fc1b77265
diff --git a/spec/lib/redmine/i18n_spec.rb b/spec/lib/redmine/i18n_spec.rbindex b0f012b860c..bdece981734 100644--- a/spec/lib/redmine/i18n_spec.rb+++ b/spec/lib/redmine/i18n_spec.rb@@ -190,5 +190,21 @@ module OpenProjectendendend++ describe '#format_date' do+ context 'without a date_format setting', with_settings: { date_format: '' } do+ it 'uses the locale formate' do+ expect(format_date(Date.today))+ .to eql I18n.l(Date.today)+ end+ end++ context 'with a date_format setting', with_settings: { date_format: '%d %m %Y' } do+ it 'adheres to the format' do+ expect(format_date(Date.today))+ .to eql Date.today.strftime('%d %m %Y')+ end+ end+ endendenddiff --git a/spec_legacy/unit/lib/redmine/i18n_spec.rb b/spec_legacy/unit/lib/redmine/i18n_spec.rbindex c6a1fbb0dc2..55c333d032c 100644--- a/spec_legacy/unit/lib/redmine/i18n_spec.rb+++ b/spec_legacy/unit/lib/redmine/i18n_spec.rb@@ -36,20 +36,6 @@ describe Redmine::I18n do@hook_module = Redmine::Hookend- it 'should date format default' do- set_language_if_valid 'en'- today = Date.today- Setting.date_format = ''- assert_equal I18n.l(today), format_date(today)- end-- it 'should date format' do- set_language_if_valid 'en'- today = Date.today- Setting.date_format = '%d %m %Y'- assert_equal today.strftime('%d %m %Y'), format_date(today)- end-it 'should date and time for each language' doSetting.date_format = ''valid_languages.each do |lang|