Sha256: 4163bde4dbb2b8873bf21211d73ba30572414f62786f52aac616dae45d08affb

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

require "action_dispatch"
require "action_dispatch/testing/test_response"

module ActionDispatch
  module Testing
    module ResponsePredicates
      # Was the response successful?
      def success?
        ActiveSupport::Deprecation.warn(<<~MSG)
          The success? predicate is deprecated and was removed in Rails 6.0.
          Please use successful? as provided by Rack::Response::Helpers.
        MSG
        successful?
      end

      # Was the URL not found?
      def missing?
        ActiveSupport::Deprecation.warn(<<~MSG)
          The missing? predicate is deprecated and was removed in Rails 6.0.
          Please use not_found? as provided by Rack::Response::Helpers.
        MSG
        not_found?
      end

      # Was there a server-side error?
      def error?
        ActiveSupport::Deprecation.warn(<<~MSG)
          The error? predicate is deprecated and was removed in Rails 6.0.
          Please use server_error? as provided by Rack::Response::Helpers.
        MSG
        server_error?
      end
    end
  end
end

ActionDispatch::TestResponse.send(:include, ActionDispatch::Testing::ResponsePredicates)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
action_dispatch_test_predicates-0.1.0 lib/action_dispatch/testing/response_predicates.rb