Sha256: 783819c37628666ef7b492c873fee5c0c27ed88cda06042990405bb628addcef

Contents?: true

Size: 455 Bytes

Versions: 6

Compression:

Stored size: 455 Bytes

Contents

module TestHelpers
  module Matchers
    module Response
      # @param [Array<Object>] ids
      # @return [ActionDispatch::TestResponse]
      def response_with_ids(ids)
        response_with_body(JSON.dump(data: ids.map { |id| { 'id' => id } }))
      end

      # @param [String] body
      # @return [ActionDispatch::TestResponse]
      def response_with_body(body)
        ActionDispatch::TestResponse.new(200, {}, body)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
infinum_json_api_setup-0.0.8 spec/support/test_helpers/matchers/response.rb
infinum_json_api_setup-0.0.7 spec/support/test_helpers/matchers/response.rb
infinum_json_api_setup-0.0.6 spec/support/test_helpers/matchers/response.rb
infinum_json_api_setup-0.0.5 spec/support/test_helpers/matchers/response.rb
infinum_json_api_setup-0.0.4 spec/support/test_helpers/matchers/response.rb
infinum_json_api_setup-0.0.3 spec/support/test_helpers/matchers/response.rb