spec/views_base_spec.rb in alephant-renderer-0.0.9 vs spec/views_base_spec.rb in alephant-renderer-0.0.10
- old
+ new
@@ -21,7 +21,21 @@
it "Translates a key for an overridden locale" do
Alephant::Renderer.create('welsh', base_path, :model)
expect(Fixtures::Welsh.new.t('bar')).to eq('Welsh Translation')
end
+
+ it "Uses the translation keys value if no translation and no default set" do
+ Alephant::Renderer.create('welsh', base_path, :model)
+
+ expect(Fixtures::Welsh.new.t('non_existent')).to eq('non_existent')
+ end
+ end
+
+ describe "t(key, param{:default => 'A default'})" do
+ it "Uses the passed in default if translation key does not exist" do
+ Alephant::Renderer.create('welsh', base_path, :model)
+
+ expect(Fixtures::Welsh.new.t('non_existent', :default => 'A default')).to eq('A default')
+ end
end
end