aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/languages_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-05-28 09:22:01 +0100
committerLouise Crow <louise.crow@gmail.com>2015-05-28 09:22:01 +0100
commit00a74de49966373832a63efb0d6f702825b6554d (patch)
tree6243ec8756e13e0b5c0b8b072bf2bebe8f8103b3 /spec/lib/languages_spec.rb
parentfd1c62d447e94503d857b2c3463eef93ab231ca6 (diff)
parentcfb656ca40cbe4e34a5df795bb8514e427c8c708 (diff)
Merge branch 'locale-specific-language-name' into rails-3-develop
Diffstat (limited to 'spec/lib/languages_spec.rb')
-rw-r--r--spec/lib/languages_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/languages_spec.rb b/spec/lib/languages_spec.rb
new file mode 100644
index 000000000..38f611087
--- /dev/null
+++ b/spec/lib/languages_spec.rb
@@ -0,0 +1,22 @@
+# -*- encoding : utf-8 -*-
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe LanguageNames do
+
+ describe :get_language_name do
+
+ it 'should return the name assigned to the language' do
+ LanguageNames.get_language_name('en').should == 'English'
+ end
+
+ it 'should return the name assigned to the language when there is no specific location' do
+ LanguageNames.get_language_name('pt_BR').should == 'Português'
+ end
+
+ it 'should return the name assigned to the language/location combination' do
+ LanguageNames.get_language_name('zh_HK').should == '中文(香港)'
+ end
+
+ end
+
+end