Sha256: 8b2d50f83491ff867da9ff6e32de9ed065ae7c24cb91cf1da4d891f161039395

Contents?: true

Size: 555 Bytes

Versions: 7

Compression:

Stored size: 555 Bytes

Contents

require 'test_helper'
require 'adyen/rest/response'

class RESTResponseTest < Minitest::Test

  def setup
    @http_response = mock
    @http_response.stubs(body: 'result.a=123&result.b.c=456&result.camelCase=789')
    @response = Adyen::REST::Response.new(@http_response, prefix: 'result')
  end

  def test_getting_attributes
    assert_equal '123', @response[:a]
    assert_equal '123', @response['a']
    assert_equal '123', @response['result.a']
    assert_equal '789', @response['camelCase']
    assert_equal '789', @response[:camel_case]
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
adyen-2.4.0 test/unit/rest_response_test.rb
adyen_jpiqueras-2.5.0 test/rest_response_test.rb
adyen-2.3.0 test/unit/rest_response_test.rb
adyen_jpiqueras-2.4.0 test/rest_response_test.rb
adyen_jpiqueras-2.3.0 test/rest_response_test.rb
adyen-2.2.0 test/rest_response_test.rb
adyen-2.1.0 test/rest_response_test.rb