Sha256: c7f5a1652a03a6f251d37f7648b620390b2fb4915df3b30a66184d2e379cec5d

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

require 'spec_helper'
require 'locale_app/exception_handler'

describe LocaleApp::ExceptionHandler, '#call(exception, locale, key, options)' do
  before(:each) do
    LocaleApp.configure do |config|
      config.api_key = 'abcdef'
    end
  end

  it "adds the missing translation to the missing translation list" do
    LocaleApp.missing_translations.should_receive(:add).with(:en, 'foo', { :baz => 'bam' })
    I18n.t('foo', :baz => 'bam')
  end

  it "handles when the key is an array of keys" do
    LocaleApp.missing_translations.should_receive(:add).with(:en, 'foo', {})
    LocaleApp.missing_translations.should_receive(:add).with(:en, 'bar', {})
    I18n.t(['foo', 'bar'])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
localeapp-0.0.7 spec/locale_app/exception_handler_spec.rb