Sha256: e0267ccc94d1e8ee0e69f33ebb21c69526087415b771940020a40fca3082fed1

Contents?: true

Size: 673 Bytes

Versions: 9

Compression:

Stored size: 673 Bytes

Contents

require "test_helper"

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

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

    test "should update resource" do
      put :update,
          :id => @resource,
          :resource => { :name => "Update" }

      assert_json_resource(@resource.reload)
    end

    test "should not update resource with invalid id" do
      assert_raise(ActiveRecord::RecordNotFound) do
        put :update,
            :id => 1234567890,
            :resource => { :name => "Update" }
      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/update_test.rb
fogged-0.0.12 test/controllers/fogged/resources_controller/update_test.rb
fogged-0.0.11 test/controllers/fogged/resources_controller/update_test.rb
fogged-0.0.10 test/controllers/fogged/resources_controller/update_test.rb
fogged-0.0.9 test/controllers/fogged/resources_controller/update_test.rb
fogged-0.0.8 test/controllers/fogged/resources_controller/update_test.rb
fogged-0.0.7 test/controllers/fogged/resources_controller/update_test.rb
fogged-0.0.6 test/controllers/fogged/resources_controller/update_test.rb
fogged-0.0.5 test/controllers/fogged/resources_controller/update_test.rb