Sha256: 3e16e63d4419baf9807719150110e8975766e19b4d3ca3820c0a303241bf1b5e

Contents?: true

Size: 984 Bytes

Versions: 2

Compression:

Stored size: 984 Bytes

Contents

require 'spec_helper'

module Alchemy
  describe "ActsAsEssence" do
    #let(:element) { FactoryGirl.create(:element, :name => 'headline', :create_contents_after_create => true) }
    let(:essence) { Alchemy::EssenceText.new }

    describe '#ingredient=' do
      it 'should set the value to ingredient column' do
        essence.ingredient = 'Hallo'
        expect(essence.ingredient).to eq('Hallo')
      end
    end

    describe '#open_link_in_new_window?' do

      subject { essence.open_link_in_new_window? }

      context 'essence responds to link_taget' do
        context 'if link_target attribute is set to "blank"' do

          before { essence.link_target = 'blank' }

          it "should return true" do
            expect(subject).to eq(true)
          end
        end

        context 'if link_target attribute is not "blank"' do
          it "should return false" do
            expect(subject).to eq(false)
          end
        end
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alchemy_cms-2.7.1 spec/libraries/essence_spec.rb
alchemy_cms-2.7.0 spec/libraries/essence_spec.rb