Sha256: e346789f0b931d1a283e8c4a39e6481c22dd8595a4c1f1c38176102e78d13274

Contents?: true

Size: 633 Bytes

Versions: 2

Compression:

Stored size: 633 Bytes

Contents

shared_examples_for "a proper translator" do
  it "#field must return a translation" do
    I18n.with_locale(:en) do
      expect(@user.first_name).to eq 'Jon'
    end
  end

  context "when the translation data doesn't contain the desired language" do
    it "#field must return the original data" do
      I18n.with_locale(:de) do
        expect(@user.first_name).to eq 'Joao'
      end
    end
  end

  context "when the translation data doesn't contain the desired field" do
    it "#field must return the original data" do
      I18n.with_locale(:en) do
        expect(@user.title).to eq 'Cavaleiro'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lost_in_translations-1.3.0 spec/support/shared_examples/proper_translator.rb
lost_in_translations-1.2.0 spec/support/shared_examples/proper_translator.rb