Sha256: 03b72a4b685312ff34e3c7cfbab04aa217f7ab7e2d08ec7c4bb77ffc717058f0

Contents?: true

Size: 973 Bytes

Versions: 27

Compression:

Stored size: 973 Bytes

Contents

require 'spec_helper'

describe Alchemy::Admin::ContentsHelper do

  before(:each) do
    @element = FactoryGirl.create(:element, :name => 'article', :create_contents_after_create => true)
  end

  it "should render a dom id" do
    helper.content_dom_id(@element.content_by_type('EssenceText')).should match(/essence_text_\d{1,}/)
  end

  it "should render the content name" do
    helper.render_content_name(@element.content_by_type('EssenceText')).should == "Intro"
  end

  it "should render a link to add new content to element" do
    helper.stub!(:render_icon).and_return('')
    helper.render_new_content_link(@element).should match(/a.+href.*admin\/elements\/#{@element.id}\/contents\/new/m)
  end

  it "should render a link to create a content in element" do
    helper.stub!(:render_icon).and_return('')
    helper.render_create_content_link(@element, 'headline').should match(/a.+href.*admin\/contents.+class.+new_content_link.*data-method.+post/)
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
alchemy_cms-2.6.3 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.6.2.1 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.6.2 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.6.1 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.6.0 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.6.0.rc5 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.3.1 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.3 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.2.2 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.2.1 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.2 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.1 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.0 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.0.rc3 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.0.b9 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.3.2 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.4.1 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.0.b5 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.5.0.b2 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.4.0 spec/helpers/admin/contents_helper_spec.rb