summaryrefslogtreecommitdiff
path: root/vendor/plugins/globalize2/test/translation_test.rb
diff options
context:
space:
mode:
authorhukl <hukl@eight.local>2009-02-07 15:50:40 +0100
committerhukl <hukl@eight.local>2009-02-07 15:50:40 +0100
commit36a2f1f3c085dd81171cf7d8220770d4ff921ab3 (patch)
tree5ded15331b192bf428af4c94d46d1abb28ef0690 /vendor/plugins/globalize2/test/translation_test.rb
parentce9645d0092d42c7bf8781378181ffbd4ff3d088 (diff)
added globalize2 plugin as well as some modifications
which use the new translation facilities. backend mostly.
Diffstat (limited to 'vendor/plugins/globalize2/test/translation_test.rb')
-rw-r--r--vendor/plugins/globalize2/test/translation_test.rb54
1 files changed, 54 insertions, 0 deletions
diff --git a/vendor/plugins/globalize2/test/translation_test.rb b/vendor/plugins/globalize2/test/translation_test.rb
new file mode 100644
index 00000000..4b52bb10
--- /dev/null
+++ b/vendor/plugins/globalize2/test/translation_test.rb
@@ -0,0 +1,54 @@
1require File.join( File.dirname(__FILE__), 'test_helper' )
2require 'globalize/translation'
3
4class TranslationTest < ActiveSupport::TestCase
5 include Globalize
6
7 def setup
8 @translation = Translation::Static.new 'foo', :locale => :'en-US'
9 end
10
11 test "responds to fallback?" do
12 assert @translation.respond_to?( :fallback? )
13 end
14
15 test "returns true when :locale and :requested_locale are not equal" do
16 @translation.requested_locale = :'de-DE'
17 assert @translation.fallback?
18 end
19
20 test "returns false when :locale and :requested_locale are equal" do
21 @translation.requested_locale = :'en-US'
22 assert !@translation.fallback?
23 end
24
25 test "has the attribute :locale" do
26 assert @translation.respond_to?( :locale )
27 end
28
29 test "has the attribute :requested_locale" do
30 assert @translation.respond_to?( :requested_locale )
31 end
32
33 test "has the attribute :options" do
34 assert @translation.respond_to?( :options )
35 end
36
37 test "has the attribute :plural_key" do
38 assert @translation.respond_to?( :plural_key )
39 end
40
41 test "has the attribute :original" do
42 assert @translation.respond_to?( :original )
43 end
44
45 test "Translation::Attribute has the attribute :locale" do
46 translation = Translation::Attribute.new 'foo'
47 assert translation.respond_to?( :locale )
48 end
49
50 test "Translation::Attribute has the attribute :requested_locale" do
51 translation = Translation::Attribute.new 'foo'
52 assert translation.respond_to?( :requested_locale )
53 end
54end