aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_options_helper_i18n_test.rb
diff options
context:
space:
mode:
authorSven Fuchs <svenfuchs@artweb-design.de>2008-06-19 16:25:27 +0200
committerSven Fuchs <svenfuchs@artweb-design.de>2008-06-19 16:25:27 +0200
commit45d41f0dadd9fa171f306ff356770c4492726f30 (patch)
tree44829d24de330827d53e52c328b5dc8d81244656 /actionpack/test/template/form_options_helper_i18n_test.rb
parent40557e17dda0525d5d26c09b3279b83695df3f4d (diff)
downloadrails-45d41f0dadd9fa171f306ff356770c4492726f30.tar.gz
rails-45d41f0dadd9fa171f306ff356770c4492726f30.tar.bz2
rails-45d41f0dadd9fa171f306ff356770c4492726f30.zip
integrating I18n into Rails
Diffstat (limited to 'actionpack/test/template/form_options_helper_i18n_test.rb')
-rw-r--r--actionpack/test/template/form_options_helper_i18n_test.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_i18n_test.rb b/actionpack/test/template/form_options_helper_i18n_test.rb
new file mode 100644
index 0000000000..c9fc0768bb
--- /dev/null
+++ b/actionpack/test/template/form_options_helper_i18n_test.rb
@@ -0,0 +1,26 @@
+require 'abstract_unit'
+
+class FormOptionsHelperI18nTests < Test::Unit::TestCase
+ include ActionView::Helpers::FormOptionsHelper
+ attr_reader :request
+
+ def setup
+ @request = mock
+ end
+
+ def test_country_options_for_select_given_a_locale_it_does_not_check_request_for_locale
+ request.expects(:locale).never
+ country_options_for_select :locale => 'en-US'
+ end
+
+ def test_country_options_for_select_given_no_locale_it_checks_request_for_locale
+ request.expects(:locale).returns 'en-US'
+ country_options_for_select
+ end
+
+ def test_country_options_for_select_translates_country_names
+ countries = ActionView::Helpers::FormOptionsHelper::COUNTRIES
+ I18n.expects(:translate).with(:'countries.names', 'en-US').returns countries
+ country_options_for_select :locale => 'en-US'
+ end
+end \ No newline at end of file