Sha256: 96c550ed4a9e676407e5b38a3113c7a314b52f467f2af0d96f35bf29c34d5707

Contents?: true

Size: 1.51 KB

Versions: 2

Compression:

Stored size: 1.51 KB

Contents

require 'spec_helper'

module Alchemy
  describe Admin::PagesController, :js => true do

    let(:klingonian) { FactoryGirl.create(:klingonian) }
    let(:german_root) { FactoryGirl.create(:language_root_page) }
    let(:klingonian_root) { FactoryGirl.create(:language_root_page, :name => 'Klingonian', :language => klingonian) }

    before do
      german_root
      authorize_as_admin
    end

    describe "language tree switching" do

      context "in a multilangual environment" do

        before do
          klingonian_root
          Capybara.default_wait_time = 4 # Raising this helps this test to pass, even on travis-ci
        end

        it "one should be able to switch the language tree" do
          visit('/admin/pages')
          page.select 'Klingonian', :from => 'language'
          page.should have_selector('#sitemap', :text => 'Klingonian')
        end

        after { Capybara.default_wait_time = 2 } # Reset to default

      end

      context "with no language root page" do

        before { klingonian }

        it "it should display the form for creating language root" do
          visit('/admin/pages')
          page.select 'Klingonian', :from => 'language'
          page.should have_content('This language tree does not exist')
        end

      end

    end

    describe "flush complete page cache" do

      it "should remove the cache of all pages" do
        visit '/admin/pages'
        click_link 'Flush page cache'
        page.should have_content('Page cache flushed')
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alchemy_cms-2.8.3 spec/features/admin/pages_controller_spec.rb
alchemy_cms-2.8.2 spec/features/admin/pages_controller_spec.rb