Sha256: 003193599e1025a2b6193bb7817349e20b7a159a5f8979368e9e1a8c7a13eeb0

Contents?: true

Size: 947 Bytes

Versions: 2

Compression:

Stored size: 947 Bytes

Contents

require File.join(File.dirname(__FILE__), '/../../test_helper')

class Cms::FileBlocksControllerTest < ActionController::TestCase
  include Cms::ControllerTestHelper

  def setup
    login_as_cms_admin
  end
  
  def test_file_block_search
    @file = mock_file(:read => "This is a test")
    @file_block = Factory(:file_block, :attachment_section => root_section, 
      :attachment_file => @file, 
      :attachment_file_path => "/test.txt", 
      :name => "Test File", 
      :publish_on_save => true)
    @foo_section = Factory(:section, :name => "Foo", :parent => root_section)

    get :index, :section_id => root_section.id
    assert_response :success
    assert_select "td", "Test File"

    get :index, :section_id => @foo_section.id
    assert_response :success
    assert_select "td", {:count => 0, :text => "Test File"}

    get :index, :section_id => 'all'
    assert_response :success
    assert_select "td", "Test File"
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nate-browsercms-3.0.210 test/functional/cms/file_blocks_controller_test.rb
nate-browsercms-3.0.211 test/functional/cms/file_blocks_controller_test.rb