Sha256: ad169d5f19026bc0a748cde51838e6a782d26b351b4bd9019730ea15a8e94052

Contents?: true

Size: 1.54 KB

Versions: 4

Compression:

Stored size: 1.54 KB

Contents

require 'spec_helper'

describe Zoomus::Actions::Meeting do

  before :all do
    @zc = zoomus_client
    @args = {
      :host_id => "dh23hdu23gd",
      :id => "123456789"
    }
  end

  describe "#meeting_get action" do
    before :each do
      stub_request(
        :post,
        zoomus_url("/meeting/get")
      ).to_return(:body => json_response("meeting_get"))
    end

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

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

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

    it "returns id and attributes" do
      res = @zc.meeting_get(@args)

      expect(res["id"]).to eq(@args[:id])
      expect(res["host_id"]).to eq(@args[:host_id])
      expect(res["topic"]).to eq("Topic for this meeting")
      expect(res["start_time"]).to eq("2012-11-25T12:00:00Z")
      expect(res["join_url"]).to eq("https://zoom.us/j/123456789")
      expect(res["start_url"]).to eq("https://zoom.us/s/123456789?zpk=hs65q23kd9sqliy612h23k")
    end
  end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zoomus-0.7.0 spec/lib/zoomus/actions/meeting/get_spec.rb
zoomus-0.6.0 spec/lib/zoomus/actions/meeting/get_spec.rb
zoomus-0.5.0 spec/lib/zoomus/actions/meeting/get_spec.rb
zoomus-0.4.0 spec/lib/zoomus/actions/meeting/get_spec.rb