Sha256: 2f3b8138cbe41825d9feb40a528bc9270ac863b897f165424630c88f202d963d
Contents?: true
Size: 813 Bytes
Versions: 20
Compression:
Stored size: 813 Bytes
Contents
require File.expand_path('../../test_helper', File.dirname(__FILE__)) class CmsUploadTest < ActiveSupport::TestCase def test_fixtures_validity Cms::Upload.all.each do |upload| assert upload.valid?, upload.errors.full_messages.to_s end end def test_validations assert_no_difference 'Cms::Upload.count' do upload = Cms::Upload.create assert upload.errors.present? assert_has_errors_on upload, [:file_file_name] end end def test_create assert_difference 'Cms::Upload.count' do cms_sites(:default).uploads.create( :file => fixture_file_upload('files/valid_image.jpg') ) end end def test_create_failure assert_no_difference 'Cms::Upload.count' do cms_sites(:default).uploads.create(:file => '') end end end
Version data entries
20 entries across 20 versions & 1 rubygems