spec/helpers/title_helper_spec.rb in title-0.0.3 vs spec/helpers/title_helper_spec.rb in title-0.0.4

- old
+ new

@@ -1,6 +1,8 @@ -require 'rubygems' +require 'coveralls' +Coveralls.wear! + require 'title' describe Title::TitleHelper do it 'is the app name when no translation is present' do stub_rails @@ -11,9 +13,17 @@ it 'uses the application title by default' do stub_rails load_translations(application: 'Not Dummy') expect(helper.title).to eq('Not Dummy') + end + + it 'uses a :default key at an arbitrary point in the lookup path' do + stub_rails + stub_controller_and_action('engine/users', :show) + load_translations(engine: { default: 'Engine name' }) + + expect(helper.title).to eq 'Engine name' end it 'matches controller/action to translation and uses that title' do stub_rails stub_controller_and_action(:dashboards, :show)