Sha256: b79288883adf1c0da00c74602650e107c7d8cff6537788f7927ad45000aaec7a

Contents?: true

Size: 1.32 KB

Versions: 8

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'

describe Zoomus::Actions::Meeting do

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

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

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

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

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

    it "returns id and deleted at attributes" do
      res = @zc.meeting_delete(@args)

      expect(res["id"]).to eq(@args[:id])
      expect(res["deleted_at"]).to eq("2013-04-05T15:50:47Z")
    end
  end

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

    it "raises Zoomus::Error exception" do
      expect {
        @zc.meeting_delete!(@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/meeting/delete_spec.rb
zoomus-0.6.0 spec/lib/zoomus/actions/meeting/delete_spec.rb
zoomus-0.5.0 spec/lib/zoomus/actions/meeting/delete_spec.rb
zoomus-0.4.0 spec/lib/zoomus/actions/meeting/delete_spec.rb
zoomus-0.3.1 spec/lib/zoomus/actions/meeting/delete_spec.rb
zoomus-0.3.0 spec/lib/zoomus/actions/meeting/delete_spec.rb
zoomus-0.2.1 spec/lib/zoomus/actions/meeting/delete_spec.rb
zoomus-0.2.0 spec/lib/zoomus/actions/meeting/delete_spec.rb