Sha256: 81482f65ac6cb1c2050f3c9e5b889704e79f2f466cb1aa94bf5b4638354effba

Contents?: true

Size: 617 Bytes

Versions: 2

Compression:

Stored size: 617 Bytes

Contents

require 'spec_helper'

describe Traducto::Helpers do
  describe "#t" do
    let(:action_view) { ActionView::Base.new }

    context "with the key welcome" do
      before { I18n.stub('translate').with('welcome', anything()).and_return('Hello!') }

      subject { action_view.t('welcome', format: :text) }

      it { should eql '<p>Hello!</p>' }
    end

    context "with the key list being an array" do
      before { I18n.stub('translate').with('list', anything()).and_return(['item1', 'item2', 'item3']) }

      subject { action_view.t('list') }

      it { should eql "item1\nitem2\nitem3" }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
traducto-1.0.6 spec/traducto/helpers_spec.rb
traducto-1.0.5 spec/traducto/helpers_spec.rb