Sha256: 30389cad917c755b6e8da814251100155e867bbcd02635a21fb77275a51c0bff

Contents?: true

Size: 1.43 KB

Versions: 27

Compression:

Stored size: 1.43 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

xdescribe Zoom::Actions::User do

  before :all do
    @zc = zoom_client
    @args = { email: 'foo@bar.com',
              first_name: 'Foo',
              last_name: 'Bar',
              type: 1 }
  end

  xdescribe '#user_custcreate action' do
    before :each do
      stub_request(
        :post,
        zoom_url('/user/custcreate')
      ).to_return(body: json_response('user', 'custcreate'))
    end

    it 'requires email param' do
      expect { @zc.user_custcreate(filter_key(@args, :email)) }.to raise_error(ArgumentError)
    end

    it 'requires type param' do
      expect { @zc.user_custcreate(filter_key(@args, :type)) }.to raise_error(ArgumentError)
    end

    it 'returns a hash' do
      expect(@zc.user_custcreate(@args)).to be_kind_of(Hash)
    end

    it 'returns same params' do
      res = @zc.user_custcreate(@args)

      expect(res['email']).to eq(@args[:email])
      expect(res['first_name']).to eq(@args[:first_name])
      expect(res['last_name']).to eq(@args[:last_name])
      expect(res['type']).to eq(@args[:type])
    end
  end

  xdescribe '#user_custcreate! action' do
    before :each do
      stub_request(
        :post,
        zoom_url('/user/custcreate')
      ).to_return(body: json_response('error'))
    end

    it 'raises Zoom::Error exception' do
      expect {
        @zc.user_custcreate!(@args)
      }.to raise_error(Zoom::Error)
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
zoom_rb-1.1.11 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.10 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.9 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.8 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.7 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.6 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.5 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.4 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.3 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.2 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.1 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.1.0 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.0.2 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.0.1 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-1.0.0 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-0.11.0 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_markazuna-0.10.0 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-0.10.0 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-0.9.1 spec/lib/zoom/actions/user/custcreate_spec.rb
zoom_rb-0.9.0 spec/lib/zoom/actions/user/custcreate_spec.rb