Sha256: 463cc374df61bdb8f460b87f53a8139819034322e72758478e837443d66d8190

Contents?: true

Size: 566 Bytes

Versions: 11

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

module Shark
  module RSpec
    module Helpers
      module Response
        def fake_response(status, body)
          serialized_body = if body.nil? || body.is_a?(String)
                              body
                            else
                              body.to_json
                            end

          {
            headers: {
              content_type: 'application/vnd.api+json'
            },
            status: status,
            body: serialized_body
          }
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bima-shark-sdk-3.1.1 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-2.5.0 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-3.1.0 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-3.0.0 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-2.4.4 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-2.4.3 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-2.4.2 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-2.4.1 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-2.4.0 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-2.3.1 lib/shark/rspec/helpers/response.rb
bima-shark-sdk-2.3.0 lib/shark/rspec/helpers/response.rb