Sha256: fad4b005eef270b7a9f7e48f8ba3f7070fa2ebbcad87cfbcc3922f440ee15fa7

Contents?: true

Size: 1.51 KB

Versions: 14

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.preview.acc_security.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://preview.twilio.com/Verification/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": "+15017122661",
          "channel": "sms",
          "status": "approved",
          "valid": false,
          "date_created": "2015-07-30T20:00:00Z",
          "date_updated": "2015-07-30T20:00:00Z"
      }
      ]
    ))

    actual = @client.preview.acc_security.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                                         .verification_checks.create(code: 'code')

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
twilio-ruby-5.31.2 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.31.1 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.31.0 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.30.0 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.29.1 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.29.0 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.28.0 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.27.1 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.27.0 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.26.0 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.25.4 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.25.3 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.25.2 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.25.1 spec/integration/preview/acc_security/service/verification_check_spec.rb