Sha256: 6868c8f19cd1621357f8b13fefe92f6c9cd8b162a13ad6fe31ccb778d2f21965

Contents?: true

Size: 666 Bytes

Versions: 29

Compression:

Stored size: 666 Bytes

Contents

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

class CmsUploadTest < ActiveSupport::TestCase
  
  def test_validations
    assert_no_difference 'CmsUpload.count' do
      upload = CmsUpload.create
      assert upload.errors.present?
      assert_has_errors_on upload, [:file_file_name]
    end
  end
  
  def test_create
    assert_difference 'CmsUpload.count' do
      cms_sites(:default).cms_uploads.create(
        :file => fixture_file_upload('files/valid_image.jpg')
      )
    end
  end
  
  def test_create_failure
    assert_no_difference 'CmsUpload.count' do
      cms_sites(:default).cms_uploads.create(:file => '')
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
comfortable_mexican_sofa-1.0.51 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.50 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.49 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.48 test/unit/cms_upload_test.rb
lucy_cms-0.0.6 test/unit/cms_upload_test.rb
lucy_cms-0.0.5 test/unit/cms_upload_test.rb
lucy_cms-0.0.4 test/unit/cms_upload_test.rb
lucy_cms-0.0.3 test/unit/cms_upload_test.rb
lucy_cms-0.0.2 test/unit/cms_upload_test.rb
lucy_cms-0.0.1 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.47 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.46 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.45 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.44 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.43 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.42 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.41 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.40 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.39 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.38 test/unit/cms_upload_test.rb