Sha256: 2d8dec0d32dcd20c5c03949f70cef3d02c0ab8b391526af0f6afaf70becdae0b

Contents?: true

Size: 1.16 KB

Versions: 10

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'
require 'shared/model_behaviour'

describe Ably::Models::ChannelDetails do
  subject { Ably::Models::ChannelDetails(channel_id: 'channel-id-123-xyz', name: 'name', status: { isActive: 'true', occupancy: { metrics: { connections: 1, presence_connections: 2, presence_members: 2, presence_subscribers: 5, publishers: 7, subscribers: 9 } } }) }

  describe '#channel_id' do
    it 'should return channel id' do
      expect(subject.channel_id).to eq('channel-id-123-xyz')
    end
  end

  describe '#name' do
    it 'should return name' do
      expect(subject.name).to eq('name')
    end
  end

  describe '#status' do
    it 'should return status' do
      expect(subject.status).to be_a(Ably::Models::ChannelStatus)
      expect(subject.status.occupancy.metrics.connections).to eq(1)
      expect(subject.status.occupancy.metrics.presence_connections).to eq(2)
      expect(subject.status.occupancy.metrics.presence_members).to eq(2)
      expect(subject.status.occupancy.metrics.presence_subscribers).to eq(5)
      expect(subject.status.occupancy.metrics.publishers).to eq(7)
      expect(subject.status.occupancy.metrics.subscribers).to eq(9)
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
ably-rest-1.2.7 lib/submodules/ably-ruby/spec/unit/models/channel_details_spec.rb
ably-1.2.7 spec/unit/models/channel_details_spec.rb
ably-rest-1.2.6 lib/submodules/ably-ruby/spec/unit/models/channel_details_spec.rb
ably-1.2.6 spec/unit/models/channel_details_spec.rb
ably-rest-1.2.4 lib/submodules/ably-ruby/spec/unit/models/channel_details_spec.rb
ably-1.2.4 spec/unit/models/channel_details_spec.rb
ably-rest-1.2.3 lib/submodules/ably-ruby/spec/unit/models/channel_details_spec.rb
ably-1.2.3 spec/unit/models/channel_details_spec.rb
ably-rest-1.2.2 lib/submodules/ably-ruby/spec/unit/models/channel_details_spec.rb
ably-1.2.2 spec/unit/models/channel_details_spec.rb