Sha256: 62a3ae172485089e789bddb9573ae7b7e8ab447031400bf4ab7b0981e17dd003

Contents?: true

Size: 1.5 KB

Versions: 4

Compression:

Stored size: 1.5 KB

Contents

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

require 'spec_helper.rb'

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

    expect {
      @client.preview.acc_security.services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
                                  .verifications.create(to: 'to', channel: 'channel')
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {'To' => 'to', 'Channel' => 'channel', }
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'post',
        url: 'https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications',
        data: values,
    ))).to eq(true)
  end

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

    actual = @client.preview.acc_security.services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
                                         .verifications.create(to: 'to', channel: 'channel')

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twilio-ruby-5.7.2 spec/integration/preview/acc_security/service/verification_spec.rb
twilio-ruby-5.7.1 spec/integration/preview/acc_security/service/verification_spec.rb
twilio-ruby-5.7.0 spec/integration/preview/acc_security/service/verification_spec.rb
twilio-ruby-5.6.4 spec/integration/preview/acc_security/service/verification_spec.rb