Sha256: ccf03c9b90ab557d01113ad6a7fe4b319643519b799e9022fbccc03dcebe5610

Contents?: true

Size: 1.39 KB

Versions: 6

Compression:

Stored size: 1.39 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

xdescribe Zoom::Actions::Report do
  let(:zc) { zoom_client}
  let(:args) { { from: '2013-04-05T15:50:47Z', to: '2013-04-09T19:00:00Z' } }
  let(:response) { zc.report_getaccountreport(args) }

  xdescribe '#report_getaccountreport action' do
    before :each do
      stub_request(
        :post,
        zoom_url('/report/getaccountreport')
      ).to_return(body: json_response('report_getaccountreport'))
    end

    it "requires a 'from' argument" do
      expect {
        zc.report_getaccountreport(filter_key(args, :from))
      }.to raise_error(ArgumentError)
    end

    it "requires a 'to' argument" do
      expect {
        zc.report_getaccountreport(filter_key(args, :to))
      }.to raise_error(ArgumentError)
    end

    it 'returns a hash' do
      expect(response).to be_kind_of(Hash)
    end

    it "returns 'total_records'" do
      expect(response['total_records']).to eq(1)
    end

    it "returns 'users' Array" do
      expect(response['users']).to be_kind_of(Array)
    end
  end

  xdescribe '#report_getaccountreport! action' do
    before :each do
      stub_request(
        :post,
        zoom_url('/report/getaccountreport')
      ).to_return(body: json_response('error'))
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
zoom_rb-0.8.6 spec/lib/zoom/actions/report/getaccountreport_spec.rb
zoom_rb-0.8.5 spec/lib/zoom/actions/report/getaccountreport_spec.rb
zoom_rb-0.8.4 spec/lib/zoom/actions/report/getaccountreport_spec.rb
zoom_rb-0.8.3 spec/lib/zoom/actions/report/getaccountreport_spec.rb
zoom_rb-0.8.2 spec/lib/zoom/actions/report/getaccountreport_spec.rb
zoom_rb-0.8.1 spec/lib/zoom/actions/report/getaccountreport_spec.rb