Sha256: c87bf06edd23944c68a4be770ba7c7b73beb10ba828dfa58c3feb7750355579d

Contents?: true

Size: 998 Bytes

Versions: 18

Compression:

Stored size: 998 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class Cms::MainControllerTest < ActionController::TestCase

  def setup
    setup_company_and_login_admin
  end

  context "asset list" do
    should "show thumbnail and show page for image assets and direct link for non-image assets" do
      img_asset = Factory(:image_asset, :context => @company)
      pdf_asset = Factory(:pdf_asset, :context => @company)

      get :index
      assert_response :success
      assert_select "li#cms_asset_#{img_asset.id} a", img_asset.asset_file_name
      assert_select "li#cms_asset_#{img_asset.id} div.asset_image"
      assert_select "li#cms_asset_#{pdf_asset.id} a", pdf_asset.asset_file_name
      assert_select "li#cms_asset_#{pdf_asset.id} div.asset_image", false
    end
  end

  context "permission access" do
    setup do
      logout_user
    end

    should "redirect to the login screen" do
      get :index
      assert_response :redirect
      assert_redirected_to '/login'
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
liquid_cms-0.2.0.12 test/functional/main_controller_test.rb
liquid_cms-0.2.0.11 test/functional/main_controller_test.rb
liquid_cms-0.2.0.10 test/functional/main_controller_test.rb
liquid_cms-0.2.0.9 test/functional/main_controller_test.rb
liquid_cms-0.2.0.8 test/functional/main_controller_test.rb
liquid_cms-0.3.0.5 test/functional/main_controller_test.rb
liquid_cms-0.2.0.7 test/functional/main_controller_test.rb
liquid_cms-0.3.0.4 test/functional/main_controller_test.rb
liquid_cms-0.2.0.6 test/functional/main_controller_test.rb
liquid_cms-0.3.0.3 test/functional/main_controller_test.rb
liquid_cms-0.2.0.5 test/functional/main_controller_test.rb
liquid_cms-0.2.0.4 test/functional/main_controller_test.rb
liquid_cms-0.3.0.2 test/functional/main_controller_test.rb
liquid_cms-0.2.0.3 test/functional/main_controller_test.rb
liquid_cms-0.2.0.2 test/functional/main_controller_test.rb
liquid_cms-0.3.0.1 test/functional/main_controller_test.rb
liquid_cms-0.3.0 test/functional/main_controller_test.rb
liquid_cms-0.2.0 test/functional/main_controller_test.rb