client_spec.rb 620 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Whatsapp::Client, :aggregate_failures do
  4. let(:access_token) { '1234' }
  5. describe '#new' do
  6. context 'with expected options' do
  7. it 'creates an instance' do
  8. expect(described_class.new(access_token:)).to be_a(described_class)
  9. end
  10. end
  11. context 'without expected options' do
  12. it 'raises an error' do
  13. expect { described_class.new(access_token: nil) }.to raise_error(ArgumentError, "The required parameter 'access_token' is missing.")
  14. end
  15. end
  16. end
  17. end