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.37 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.36 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.35 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.34 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.33 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.32 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.31 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.30 test/unit/cms_upload_test.rb
comfortable_mexican_sofa-1.0.29 test/unit/cms_upload_test.rb