Sha256: 2931ad04c8f1880178141bdbdbc31b6611c39d2d5588e0d3a25af9d18f7015e4
Contents?: true
Size: 1.92 KB
Versions: 6
Compression:
Stored size: 1.92 KB
Contents
require 'test_helper' module Cms class ConnectorsControllerTest < ActionController::TestCase include Cms::ControllerTestHelper def setup given_there_is_a_content_type Cms::HtmlBlock given_there_is_a_content_type Cms::Portlet login_as_cms_admin end def test_new @page = Factory(:page, :section => root_section, :name => "Test Page") @block = Factory(:html_block) get :new, :page_id => @page, :container => "main" assert_response :success assert_select "title", "Add Existing Content to 'Test Page' Page" end def test_new_portlet @page = Factory(:page, :section => root_section, :name => "Test Page") @portlet = Factory(:portlet, :connect_to_page_id => @page.id, :connect_to_container => "main") reset(:page) get :new, :page_id => @page, :container => "main", :block_type => "portlets" assert_response :success assert_select "title", "Add Existing Content to 'Test Page' Page" end def test_new_with_deleted_portlet @page = Factory(:page, :section => root_section, :name => "Test Page") @portlet = Factory(:portlet) @portlet.destroy get :new, :page_id => @page, :container => "main", :block_type => "portlets" assert_response :success assert_select "#dynamic_portlet_#{@portlet.id}", :count => 0 end def test_destroy @page = Factory(:page, :section => root_section) @block = Factory(:html_block, :connect_to_page_id => @page.id, :connect_to_container => "main") reset(:page) page_version_count = Page::Version.count assert_equal 2, @page.draft.version delete :destroy, :id => @page.connectors.for_page_version(@page.draft.version).first.id reset(:page) assert_redirected_to @page.path assert_incremented page_version_count, Page::Version.count assert_equal 3, @page.draft.version assert @page.connectors.for_page_version(@page.draft.version).empty? end end end
Version data entries
6 entries across 6 versions & 1 rubygems