Sha256: 2a60db74908e5349139f5154c3ca448ef2441d13cf3d9be76c6a731943a54504

Contents?: true

Size: 719 Bytes

Versions: 3

Compression:

Stored size: 719 Bytes

Contents

require File.expand_path('../../spec_helper', __FILE__)

RSpec.describe Ucpaas::Manage do
  let(:target_class) do
    Class.new do
      include Ucpaas::Manage
    end
  end

  subject { target_class.new }

  it :find_or_create_client do
    get_resp = {
      'resp' => {
        'respCode' => '000000',
        'client' => nil
      }
    }
    post_resp = {
      'resp' => {
        'respCode' => '000000',
        'client' => { 'clientNumber' => '11111' }
      }
    }
    expect(subject).to receive(:get).and_return(get_resp)
    expect(subject).to receive(:post).and_return(post_resp)
    client = subject.find_or_create_client 'appid', '+8618888888888'
    expect(client).to have_key('clientNumber')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ucpaas-0.1.4 spec/ucpaas/manage_spec.rb
ucpaas-0.1.3 spec/ucpaas/manage_spec.rb
ucpaas-0.1.2 spec/ucpaas/manage_spec.rb