Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 34 lines (26 sloc) 0.891 kB
a78e063 @binarylogic cleanup test suite for 1.9.2
authored
1 require 'test_helper'
14dc9a7 @m4n Make i18n scope configurable
m4n authored
2
3 class I18nTest < ActiveSupport::TestCase
4 def test_uses_authlogic_as_scope_by_default
5 assert_equal :authlogic, Authlogic::I18n.scope
6 end
7
8 def test_can_set_scope
de35f99 @m4n Introduce i18n translator class that can be replaced by a custom tran…
m4n authored
9 assert_nothing_raised { Authlogic::I18n.scope = [:a, :b] }
14dc9a7 @m4n Make i18n scope configurable
m4n authored
10 assert_equal [:a, :b], Authlogic::I18n.scope
11 Authlogic::I18n.scope = :authlogic
12 end
de35f99 @m4n Introduce i18n translator class that can be replaced by a custom tran…
m4n authored
13
14 def test_uses_built_in_translator_by_default
15 assert_equal Authlogic::I18n::Translator, Authlogic::I18n.translator.class
16 end
17
18 def test_can_set_custom_translator
19 old_translator = Authlogic::I18n.translator
20
21 assert_nothing_raised do
22 Authlogic::I18n.translator = Class.new do
23 def translate(key, options = {})
24 "Translated: #{key}"
25 end
26 end.new
27 end
28
29 assert_equal "Translated: x", Authlogic::I18n.translate(:x)
30
31 Authlogic::I18n.translator = old_translator
32 end
14dc9a7 @m4n Make i18n scope configurable
m4n authored
33 end
Something went wrong with that request. Please try again.