Sha256: 3a5e62460a231fd06ca8ea484cdd6bac32bacadcceeecb08c125792387d6d6f4

Contents?: true

Size: 714 Bytes

Versions: 18

Compression:

Stored size: 714 Bytes

Contents

require 'spec_helper'

module Alchemy
  shared_examples_for "having a hint" do

    describe '#hint' do
      context 'with hint as text' do
        before do
          expect(subject).to receive(:definition).and_return({'hint' => 'The hint'})
        end

        it "returns the hint" do
          expect(subject.hint).to eq('The hint')
        end
      end

      context 'with hint set to true' do
        before do
          expect(subject).to receive(:definition).and_return({'hint' => true})
          expect(I18n).to receive(:t).and_return('The hint')
        end

        it "returns the hint from translation" do
          expect(subject.hint).to eq('The hint')
        end
      end
    end

  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
alchemy_cms-3.2.1 spec/support/hint_examples.rb
alchemy_cms-3.1.3 spec/support/hint_examples.rb
lc_alchemy_cms-3.2.1 spec/support/hint_examples.rb
lc_alchemy_cms-3.2.0 spec/support/hint_examples.rb
alchemy_cms-3.2.0 spec/support/hint_examples.rb
alchemy_cms-3.2.0.rc1 spec/support/hint_examples.rb
alchemy_cms-3.2.0.beta spec/support/hint_examples.rb
alchemy_cms-3.1.1 spec/support/hint_examples.rb
alchemy_cms-3.1.0 spec/support/hint_examples.rb
alchemy_cms-3.1.0.rc3 spec/support/hint_examples.rb
alchemy_cms-3.1.0.rc2 spec/support/hint_examples.rb
alchemy_cms-3.1.0.rc1 spec/support/hint_examples.rb
alchemy_cms-3.1.0.beta6 spec/support/hint_examples.rb
alchemy_cms-3.1.0.beta5 spec/support/hint_examples.rb
alchemy_cms-3.1.0.beta4 spec/support/hint_examples.rb
alchemy_cms-3.1.0.beta3 spec/support/hint_examples.rb
alchemy_cms-3.1.0.beta2 spec/support/hint_examples.rb
alchemy_cms-3.1.0.beta1 spec/support/hint_examples.rb