Sha256: bbc17158a93c3382ef70061f04d40e0c09c7de8df67ef64e60c8dd18786e931e

Contents?: true

Size: 777 Bytes

Versions: 9

Compression:

Stored size: 777 Bytes

Contents

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

class CmsAdmin::UploadsControllerTest < ActionController::TestCase
  
  def test_create
    assert_difference 'Cms::Upload.count', 1 do
      xhr :post, :create, :site_id => cms_sites(:default), :file => fixture_file_upload('files/valid_image.jpg')
      assert_response :success
    end
  end
  
  def test_create_failure
    assert_no_difference 'Cms::Upload.count' do
      xhr :post, :create, :site_id => cms_sites(:default), :file => nil
      assert_response :bad_request
    end
  end
  
  def test_destroy
    assert_difference 'Cms::Upload.count', -1 do
      xhr :delete, :destroy, :site_id => cms_sites(:default), :id => cms_uploads(:default)
      assert_response :success
    end
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.3.8 test/functional/cms_admin/uploads_controller_test.rb
comfortable_mexican_sofa-1.3.7 test/functional/cms_admin/uploads_controller_test.rb
comfortable_mexican_sofa-1.3.6 test/functional/cms_admin/uploads_controller_test.rb
comfortable_mexican_sofa-1.3.5 test/functional/cms_admin/uploads_controller_test.rb
comfortable_mexican_sofa-1.3.4 test/functional/cms_admin/uploads_controller_test.rb
comfortable_mexican_sofa-1.3.3 test/functional/cms_admin/uploads_controller_test.rb
comfortable_mexican_sofa-1.3.2 test/functional/cms_admin/uploads_controller_test.rb
comfortable_mexican_sofa-1.3.1 test/functional/cms_admin/uploads_controller_test.rb
comfortable_mexican_sofa-1.3.0 test/functional/cms_admin/uploads_controller_test.rb