Sha256: 112bbc6b0ecf88175a9a9db2e7ef7f69ea639bd09ed137a3e9cafd3f97e3a880

Contents?: true

Size: 923 Bytes

Versions: 34

Compression:

Stored size: 923 Bytes

Contents

require 'test_helper'

class ResourceTest < ActiveSupport::TestCase

  fixtures :resources

  def test_titles
    assert_equal "teng.pdf", resources(:pdf_document).filename
    assert_equal "Teng", resources(:pdf_document).title
  end

  def test_per_page
    assert_equal 12, Resource.per_page(dialog = true)
    assert_equal 20, Resource.per_page # dialog = false
  end

  def test_attachment_fu_options
    assert_equal 50.megabytes, Resource.attachment_options[:max_size]

    if Refinery.s3_backend
      assert_equal :s3, Resource.attachment_options[:storage]
      assert_nil Resource.attachment_options[:path_prefix]
    else
      assert_equal :file_system, Resource.attachment_options[:storage]
      assert_equal 'public/system/resources', Resource.attachment_options[:path_prefix]
    end
  end

  def test_type_of_content
    assert_equal "application pdf", resources(:pdf_document).type_of_content
  end

end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
refinerycms-0.9.7.15 test/unit/resource_test.rb
refinerycms-0.9.7.14 test/unit/resource_test.rb
refinerycms-0.9.7.13 test/unit/resource_test.rb
refinerycms-0.9.7.11 test/unit/resource_test.rb
refinerycms-0.9.7.10 test/unit/resource_test.rb
refinerycms-0.9.7.9 test/unit/resource_test.rb
refinerycms-0.9.7.8 test/unit/resource_test.rb
refinerycms-0.9.7.7 test/unit/resource_test.rb
refinerycms-0.9.7.6 test/unit/resource_test.rb
refinerycms-0.9.7.5 test/unit/resource_test.rb
refinerycms-0.9.7.4 test/unit/resource_test.rb
refinerycms-0.9.7.3 test/unit/resource_test.rb
refinerycms-0.9.7.2 test/unit/resource_test.rb
refinerycms-0.9.7.1 test/unit/resource_test.rb
refinerycms-0.9.7 test/unit/resource_test.rb
refinerycms-0.9.6.34 test/unit/resource_test.rb
refinerycms-0.9.6.33 test/unit/resource_test.rb
refinerycms-0.9.6.32 test/unit/resource_test.rb
refinerycms-0.9.6.31 test/unit/resource_test.rb
refinerycms-0.9.6.30 test/unit/resource_test.rb