Sha256: 72117f19e91585c4e0d2aff622ec1954d444ce7516be59b7114944ca0e3021cf

Contents?: true

Size: 1.51 KB

Versions: 5

Compression:

Stored size: 1.51 KB

Contents

##
# This code was generated by
# \ / _    _  _|   _  _
#  | (_)\/(_)(_|\/| |(/_  v1.0.0
#       /       /
# 
# frozen_string_literal: true

require 'spec_helper.rb'

describe 'VerificationCheck' do
  it "can create" do
    @holodeck.mock(Twilio::Response.new(500, ''))

    expect {
      @client.verify.v1.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                       .verification_checks.create(code: 'code')
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {'Code' => 'code', }
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'post',
        url: 'https://verify.twilio.com/v1/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck',
        data: values,
    ))).to eq(true)
  end

  it "receives verification_checks responses" do
    @holodeck.mock(Twilio::Response.new(
        201,
      %q[
      {
          "sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "to": "+14159373912",
          "channel": "sms",
          "status": "approved",
          "valid": false,
          "amount": "$29.99",
          "payee": "Acme",
          "date_created": "2015-07-30T20:00:00Z",
          "date_updated": "2015-07-30T20:00:00Z"
      }
      ]
    ))

    actual = @client.verify.v1.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                              .verification_checks.create(code: 'code')

    expect(actual).to_not eq(nil)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
twilio-ruby-5.22.0 spec/integration/verify/v1/service/verification_check_spec.rb
twilio-ruby-5.21.2 spec/integration/verify/v1/service/verification_check_spec.rb
twilio-ruby-5.21.1 spec/integration/verify/v1/service/verification_check_spec.rb
twilio-ruby-5.21.0 spec/integration/verify/v1/service/verification_check_spec.rb
twilio-ruby-5.20.1 spec/integration/verify/v1/service/verification_check_spec.rb