Sha256: 00cbec53e6c4a6cc610c63df56be0a512d561bab7741621904c754b6e4553afd

Contents?: true

Size: 712 Bytes

Versions: 9

Compression:

Stored size: 712 Bytes

Contents

require "test_helper"

module Fogged
  class ResourcesControllerDestroyTest < ActionController::TestCase
    tests ResourcesController
    include ResourceTestHelper

    def setup
      super
      @resource = fogged_resources(:resource_png_1)
    end

    test "should destroy resource" do
      assert_difference("Resource.count", -1) do
        delete :destroy, :id => @resource
      end

      assert_response :no_content
      assert response.body.blank?
    end

    test "should not destroy resource with invalid id" do
      assert_no_difference("Resource.count") do
        assert_raise(ActiveRecord::RecordNotFound) do
          delete :destroy, :id => 123456
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fogged-0.0.13 test/controllers/fogged/resources_controller/destroy_test.rb
fogged-0.0.12 test/controllers/fogged/resources_controller/destroy_test.rb
fogged-0.0.11 test/controllers/fogged/resources_controller/destroy_test.rb
fogged-0.0.10 test/controllers/fogged/resources_controller/destroy_test.rb
fogged-0.0.9 test/controllers/fogged/resources_controller/destroy_test.rb
fogged-0.0.8 test/controllers/fogged/resources_controller/destroy_test.rb
fogged-0.0.7 test/controllers/fogged/resources_controller/destroy_test.rb
fogged-0.0.6 test/controllers/fogged/resources_controller/destroy_test.rb
fogged-0.0.5 test/controllers/fogged/resources_controller/destroy_test.rb