Sha256: 63a6b0006922718b9c3607336fe80e4deef0d4b66f3eaaf1ac19385c73814d1c

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

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

require 'spec_helper.rb'

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

    expect {
      @client.preview.acc_security.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                                  .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/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/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,
          "date_created": "2015-07-30T20:00:00Z",
          "date_updated": "2015-07-30T20:00:00Z"
      }
      ]
    ))

    actual = @client.preview.acc_security.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                                         .verification_checks.create(code: "code")

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twilio-ruby-5.6.0 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.5.1 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.5.0 spec/integration/preview/acc_security/service/verification_check_spec.rb
twilio-ruby-5.4.5 spec/integration/preview/acc_security/service/verification_check_spec.rb