test/translator_test.rb in titlezilla-0.1.1 vs test/translator_test.rb in titlezilla-0.1.2

- old
+ new

@@ -13,16 +13,16 @@ t.action_name.must_equal 'index' end it 'should initialize namespace' do t = Translator.new('admin/main', 'index') - t.namespace.must_equal 'admin' + t.namespace.must_equal ['admin'] end it 'should initialize from symbols' do t = Translator.new(:'admin/main', :index) - t.namespace.must_equal 'admin' + t.namespace.must_equal ['admin'] t.controller_name.must_equal 'main' t.action_name.must_equal 'index' end end @@ -34,9 +34,15 @@ end it 'should lookup action title with namespace' do load_translations({ admin: { main: { index: 'Index' } } }) t = Translator.new('admin/main', :index) + t.title.must_equal 'Index' + end + + it 'should lookup action title with deep namespace' do + load_translations({ admin: { billing: { main: { index: 'Index' } } } }) + t = Translator.new('admin/billing/main', :index) t.title.must_equal 'Index' end it 'should lookup mapped actions title' do load_translations({ main: { new: 'New' } })