Sha256: 7899714af4801eb52267992fd8d30cda59da58768aadcde63303e25f64d846ab

Contents?: true

Size: 941 Bytes

Versions: 8

Compression:

Stored size: 941 Bytes

Contents

require 'spec_helper'

describe Alchemy::Admin::ContentsHelper do

  before(:each) do
    @element = FactoryGirl.create(:element, :name => 'article')
  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.+button new_content_link.*data-method.+post/)
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alchemy_cms-2.2.4 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.2.3.2 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.2.3.1 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.2.2 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.2.1 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.2.0 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.2.rc15 spec/helpers/admin/contents_helper_spec.rb
alchemy_cms-2.2.rc14 spec/helpers/admin/contents_helper_spec.rb