Sha256: 005e972b861003f735225119fbc224001284bde5edaf94f8570a25a6cf8f47a3

Contents?: true

Size: 1.54 KB

Versions: 9

Compression:

Stored size: 1.54 KB

Contents

require 'spec_helper'

module Alchemy
  describe "Page creation" do
    before { authorize_as_admin }

    describe "overlay GUI" do
      context "without having a Page in the clipboard" do
        it "does not contain tabs" do
          visit new_admin_page_path
          within('#main_content') { expect(page).to_not have_selector('#overlay_tabs') }
        end
      end

      context "when having a Page in the clipboard" do
        before { Page.stub all_from_clipboard_for_select: [build_stubbed(:page)] }

        it "contains tabs for creating a new page and pasting from clipboard" do
          visit new_admin_page_path
          within('#overlay_tabs') { expect(page).to have_selector '#create_page_tab, #paste_page_tab' }
        end

        context "", js: true do
          before do
            visit admin_pages_path
            page.first(:link, 'Create a new subpage').click
          end

          it "the create page tab is visible by default" do
            within('#overlay_tabs') do
              expect(find '#create_page_tab').to be_visible
              expect(find '#paste_page_tab').to_not be_visible
            end
          end

          context "when clicking on an inactive tab" do
            it "shows that clicked tab" do
              within('#overlay_tabs') do
                click_link('Paste from clipboard')
                expect(find '#create_page_tab').to_not be_visible
                expect(find '#paste_page_tab').to be_visible
              end
            end
          end
        end
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 spec/features/admin/page_creation_feature_spec.rb
alchemy_cms-3.0.3 spec/features/admin/page_creation_feature_spec.rb
alchemy_cms-3.0.2 spec/features/admin/page_creation_feature_spec.rb
alchemy_cms-3.0.1 spec/features/admin/page_creation_feature_spec.rb
alchemy_cms-3.0.0 spec/features/admin/page_creation_feature_spec.rb
alchemy_cms-3.0.0.rc8 spec/features/admin/page_creation_feature_spec.rb
alchemy_cms-3.0.0.rc7 spec/features/admin/page_creation_feature_spec.rb
alchemy_cms-3.0.0.rc6 spec/features/admin/page_creation_feature_spec.rb
alchemy_cms-3.0.0.rc5 spec/features/admin/page_creation_feature_spec.rb