Sha256: c5a181d7cb33f0b896dc2e3798255f894c366ba23d568256ddb9ff973cc88bf7

Contents?: true

Size: 1.44 KB

Versions: 41

Compression:

Stored size: 1.44 KB

Contents

require 'spec_helper'

describe "Link overlay" do

  before do
    authorize_as_admin
  end

  context "GUI" do

    it "has a tab for linking internal pages" do
      visit link_admin_pages_path
      within('#overlay_tabs') { page.should have_content('Internal')}
    end

    it "has a tab for linking external pages" do
      visit link_admin_pages_path
      within('#overlay_tabs') { page.should have_content('External')}
    end

    it "has a tab for linking files" do
      visit link_admin_pages_path
      within('#overlay_tabs') { page.should have_content('File')}
    end

  end

  context "linking internal pages" do

    let(:lang_root) do
      FactoryGirl.create(:language_root_page)
    end

    before do
      public_page = FactoryGirl.create(:public_page, :parent_id => lang_root.id)
      public_page_2 = FactoryGirl.create(:public_page, :parent_id => lang_root.id)
    end

    it "should have a tree of internal pages" do
      visit link_admin_pages_path
      page.should have_selector('ul#sitemap li a')
    end

    it "should not have a link for pages that redirect to external" do
      redirect = FactoryGirl.create(:page, :parent_id => lang_root.id, :name => 'Google', :urlname => 'http://www.google.com')
      Alchemy::Page.any_instance.stub(:definition).and_return({'redirects_to_external' => true})
      visit link_admin_pages_path
      page.should_not have_selector('ul#sitemap li div[name="/http-www-google-com"] a')
    end

  end

end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
alchemy_cms-2.9.1 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.9.0 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.8.3 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.7.5 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.6.3 spec/features/admin/link_overlay_spec.rb
alchemy_cms-3.0.0.rc7 spec/features/admin/link_overlay_spec.rb
alchemy_cms-3.0.0.rc6 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.7.4 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.8.2 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.8.1 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.7.3 spec/features/admin/link_overlay_spec.rb
alchemy_cms-3.0.0.rc5 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.7.2 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.7.1 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.7.0 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.6.2.1 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.6.2 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.6.1 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.6.0 spec/features/admin/link_overlay_spec.rb
alchemy_cms-2.6.0.rc5 spec/features/admin/link_overlay_spec.rb