class UserTest

Public Instance Methods

test_user_create() click to toggle source
# File lib/ost-kyc-sdk-ruby/test/user_test.rb, line 35
def test_user_create
  unique_email = "usertest+#{Time.now.to_i}_#{RUBY_VERSION}@ost.com"
  result = user_obj.create(email: unique_email)
  assert_equal(result.success?, true)
end
test_user_get() click to toggle source
# File lib/ost-kyc-sdk-ruby/test/user_test.rb, line 12
def test_user_get
  result = user_obj.get(id: ENV['USER_ID'])
  assert_equal(result.success?, true)
end
test_user_get_with_null_as_user_id() click to toggle source
# File lib/ost-kyc-sdk-ruby/test/user_test.rb, line 22
def test_user_get_with_null_as_user_id
  assert_raise(RuntimeError) {
    user_obj.get(id: "")
  }
end
test_user_get_with_zero_as_user_id() click to toggle source
# File lib/ost-kyc-sdk-ruby/test/user_test.rb, line 17
def test_user_get_with_zero_as_user_id
  result = user_obj.get(id: 0)
  assert_equal(result.success?, false)
end
test_user_list() click to toggle source
# File lib/ost-kyc-sdk-ruby/test/user_test.rb, line 41
def test_user_list
  result = user_obj.list()
  assert_equal(result.success?, true)
end
test_user_list_with_total_entry_in_meta() click to toggle source
# File lib/ost-kyc-sdk-ruby/test/user_test.rb, line 28
def test_user_list_with_total_entry_in_meta
  params = {order: 'asc', limit: 1, filters: {is_kyc_submitted: false}}
  result = user_obj.list(params)
  assert_equal(result.data["meta"]["next_page_payload"]["limit"], 1)
  assert_equal(result.data["meta"]["next_page_payload"]["filters"]["is_kyc_submitted"], "false")
end
user_obj() click to toggle source
# File lib/ost-kyc-sdk-ruby/test/user_test.rb, line 8
def user_obj
  @user_obj ||= Config::OST_SDK.services.users
end