1 require File.join( File.dirname(__FILE__), 'test_helper' )
2 require 'globalize/translation'
4 class TranslationTest < ActiveSupport::TestCase
8 @translation = Translation::Static.new 'foo', :locale => :'en-US'
11 test "responds to fallback?" do
12 assert @translation.respond_to?( :fallback? )
15 test "returns true when :locale and :requested_locale are not equal" do
16 @translation.requested_locale = :'de-DE'
17 assert @translation.fallback?
20 test "returns false when :locale and :requested_locale are equal" do
21 @translation.requested_locale = :'en-US'
22 assert !@translation.fallback?
25 test "has the attribute :locale" do
26 assert @translation.respond_to?( :locale )
29 test "has the attribute :requested_locale" do
30 assert @translation.respond_to?( :requested_locale )
33 test "has the attribute :options" do
34 assert @translation.respond_to?( :options )
37 test "has the attribute :plural_key" do
38 assert @translation.respond_to?( :plural_key )
41 test "has the attribute :original" do
42 assert @translation.respond_to?( :original )
45 test "Translation::Attribute has the attribute :locale" do
46 translation = Translation::Attribute.new 'foo'
47 assert translation.respond_to?( :locale )
50 test "Translation::Attribute has the attribute :requested_locale" do
51 translation = Translation::Attribute.new 'foo'
52 assert translation.respond_to?( :requested_locale )