Sha256: 62caa1d709d152aa2e70403a6e962e9bdd775e84a3f63825b4133c63d9fa2b11

Contents?: true

Size: 1.44 KB

Versions: 8

Compression:

Stored size: 1.44 KB

Contents

require 'spec_helper'

describe Zoomus::Actions::Report do

  before :all do
    @zc = zoomus_client
    @args = {:from => '2013-04-05T15:50:47Z',
             :to => '2013-04-09T19:00:00Z'}
  end

  describe "#report_getaccountreport action" do
    before :each do
      stub_request(
        :post,
        zoomus_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(@zc.report_getaccountreport(@args)).to be_kind_of(Hash)
    end

    it "returns 'total_records'" do
      expect(@zc.report_getaccountreport(@args)["total_records"]).to eq(1)
    end

    it "returns 'users' Array" do
      expect(@zc.report_getaccountreport(@args)["users"]).to be_kind_of(Array)
    end
  end

  describe "#report_getaccountreport! action" do
    before :each do
      stub_request(
        :post,
        zoomus_url("/report/getaccountreport")
      ).to_return(:body => json_response("error"))
    end

    it "raises Zoomus::Error exception" do
      expect {
        @zc.report_getaccountreport!(@args)
      }.to raise_error(Zoomus::Error)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zoomus-0.7.0 spec/lib/zoomus/actions/report/getaccountreport_spec.rb
zoomus-0.6.0 spec/lib/zoomus/actions/report/getaccountreport_spec.rb
zoomus-0.5.0 spec/lib/zoomus/actions/report/getaccountreport_spec.rb
zoomus-0.4.0 spec/lib/zoomus/actions/report/getaccountreport_spec.rb
zoomus-0.3.1 spec/lib/zoomus/actions/report/getaccountreport_spec.rb
zoomus-0.3.0 spec/lib/zoomus/actions/report/getaccountreport_spec.rb
zoomus-0.2.1 spec/lib/zoomus/actions/report/getaccountreport_spec.rb
zoomus-0.2.0 spec/lib/zoomus/actions/report/getaccountreport_spec.rb