Sha256: 13c0875de3e266b98bac731230ac65d67366c5420404c91f999c43c630af6c6d

Contents?: true

Size: 597 Bytes

Versions: 9

Compression:

Stored size: 597 Bytes

Contents

require "spec_helper"

describe I18n::HumanizeMissingTranslations do
  describe ".call" do
    context "when exception is I18n::MissingTranslation" do
      it "humanizes missing translations" do
        expect(I18n.t("some.missing translation")).to eq("Missing translation")
      end
    end

    context "when exception is not I18n::MissingTranslation" do
      it "does not intercept it" do
        allow(I18n::Backend::Transliterator).to receive(:get).and_raise(I18n::ArgumentError)
        expect{I18n.transliterate("error?")}.to raise_error(I18n::ArgumentError)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
weeler-1.6.0 spec/weeler/i18n/humanize_missing_translations_spec.rb
weeler-1.5.4 spec/weeler/i18n/humanize_missing_translations_spec.rb
weeler-1.5.2 spec/weeler/i18n/humanize_missing_translations_spec.rb
weeler-1.5.1 spec/weeler/i18n/humanize_missing_translations_spec.rb
weeler-1.4.0 spec/weeler/i18n/humanize_missing_translations_spec.rb
weeler-1.2.0 spec/weeler/i18n/humanize_missing_translations_spec.rb
weeler-1.1.0 spec/weeler/i18n/humanize_missing_translations_spec.rb
weeler-1.0.4 spec/weeler/i18n/humanize_missing_translations_spec.rb
weeler-1.0.3 spec/weeler/i18n/humanize_missing_translations_spec.rb