Sha256: fc0f644556277fbe7892edc88dd773fc819b1d451aed1d7b2e8f7f977b667b91

Contents?: true

Size: 728 Bytes

Versions: 3

Compression:

Stored size: 728 Bytes

Contents

require 'spec_helper'

describe Loaf::Translation do

  before do
    I18n.backend = I18n::Backend::Simple.new
  end

  it 'translates breadcrumb title' do
    I18n.backend.store_translations 'en', :breadcrumbs => { :home => 'Home'}
    described_class.breadcrumb_title('breadcrumbs.home').should eql 'Home'
  end

  it 'translates breadcrumb name with default scope' do
    I18n.backend.store_translations 'en', :breadcrumbs => { :home => 'Home'}
    described_class.breadcrumb_title('home').should eql 'Home'
  end

  it 'translates breadcrumb name using default option' do
    described_class.breadcrumb_title('home', :default => 'breadcrumb default name').should eql 'breadcrumb default name'
  end

end # Loaf::Translation

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loaf-0.3.0 spec/loaf/translation_spec.rb
loaf-0.2.1 spec/loaf/translation_spec.rb
loaf-0.2.0 spec/loaf/translation_spec.rb