Class: SignatureGenerationTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/ost-kyc-sdk-ruby/test/signature_generation_test.rb

Instance Method Summary collapse

Instance Method Details

#signature_test_objObject



8
9
10
11
# File 'lib/ost-kyc-sdk-ruby/test/signature_generation_test.rb', line 8

def signature_test_obj
  params = {api_secret: "35f346e5ef825ed4499da98a6ac6b401"}
  @signature_test_obj ||= OstKycSdkRuby::Util::HTTPHelper.new(params)
end

#test_signatureObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ost-kyc-sdk-ruby/test/signature_generation_test.rb', line 13

def test_signature
  test_obj_for_signature = {
      k1: 'Rachin',
      k2: 'tejas',
      list2: [
          {a: 'L21A', b: 'L21B'},
          {a: 'L22A', b: 'L22B'},
          {a: 'L23A', b: 'L23B'}
      ],
      make_mistakes: "",
      nice_param: [],
      empty_obj: {},
      empty_str: '',
      garbage_str: "~^[]%$#@!&*~,./?~()-_'this is garbage",
      id: 11003,
      email: '[email protected]'
  }
  test_endpoint = "/api/v2/users"
  signature = signature_test_obj.get_signature_for_test(test_endpoint,test_obj_for_signature)
  assert_equal(signature, "c42188c53bfdf84e542a0a9c0a78d19c9f497c61e816f169e1907bc98477eb82")
end