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.5.3.1 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.3 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.2.2 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.2.1 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.2 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.1 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.0 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.0.rc3 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.0.b9 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.3.2 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.4.1 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.0.b5 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.5.0.b2 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.4.0 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.4.rc4 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.4.rc2 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.4.rc1 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.3.1 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.4.beta2 spec/integration/admin/link_overlay_spec.rb
alchemy_cms-2.3.0 spec/integration/admin/link_overlay_spec.rb