Sha256: 284e7cc3294f6e79ac3091a50b87cdfd7e100fb0e0bbbe45d734f48e99e8c12c

Contents?: true

Size: 626 Bytes

Versions: 9

Compression:

Stored size: 626 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
          subject.stub(definition: {'hint' => 'The hint'})
        end

        it "returns the hint" do
          subject.hint.should == 'The hint'
        end
      end

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

        it "returns the hint from translation" do
          subject.hint.should == 'The hint'
        end
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 spec/support/hint_examples.rb
alchemy_cms-3.0.3 spec/support/hint_examples.rb
alchemy_cms-3.0.2 spec/support/hint_examples.rb
alchemy_cms-3.0.1 spec/support/hint_examples.rb
alchemy_cms-3.0.0 spec/support/hint_examples.rb
alchemy_cms-3.0.0.rc8 spec/support/hint_examples.rb
alchemy_cms-3.0.0.rc7 spec/support/hint_examples.rb
alchemy_cms-3.0.0.rc6 spec/support/hint_examples.rb
alchemy_cms-3.0.0.rc5 spec/support/hint_examples.rb