(see spec/acceptance/realtime/auth_spec.rb)
- using JSON protocol
- with basic auth
- #authentication_security_requirements_met?
- #key
- #key_name
- #key_secret
- #using_basic_auth?
- #using_token_auth?
- with token auth
- #client_id
- #current_token_details
- #token_renewable?
- #options (auth_options)
- #token_params
- #using_basic_auth?
- #using_token_auth?
- methods
- #create_token_request
- #create_token_request_async
- #request_token
- #request_token_async
- #authorize
- with token auth
- with auth_callback blocking
- with a slow auth callback response
- when implicitly called, with an explicit ClientOptions client_id
- and an incompatible client_id in a TokenDetails object passed to the auth callback
- and an incompatible client_id in a TokenRequest object passed to the auth callback and fails with an exception
- when explicitly called, with an explicit ClientOptions client_id
- and an incompatible client_id in a TokenDetails object passed to the auth callback
- when already authenticated with a valid token
- ensures message delivery continuity whilst upgrading (#RTC8a1)
- when INITIALIZED
- when CONNECTING
- when FAILED
- when CLOSED
- when in the CONNECTED state
- with a valid token in the AUTH ProtocolMessage sent
- PENDING: obtains a new token (that upgrades from anonymous to identified) and upgrades the connection after receiving an updated CONNECTED ProtocolMessage (#RTC8a, #RTC8a3)
- obtains a new token (as anonymous user before & after) and upgrades the connection after receiving an updated CONNECTED ProtocolMessage (#RTC8a, #RTC8a3)
- with a valid token in the AUTH ProtocolMessage sent
- when DISCONNECTED
- when SUSPENDED
- when client is identified
- when auth fails
- when the authCallback fails
- when upgrading capabilities
- when downgrading capabilities (#RTC8a1)
- #authorize_async
- server initiated AUTH ProtocolMessage
- #auth_params
- #auth_params_sync
- #auth_header
- #auth_header_sync
- #client_id_validated?
- when using basic auth
- before connected
- once connected
- when using a token string
- with a valid client_id
- before connected
- once connected
- with no client_id (anonymous)
- before connected
- once connected
- with a wildcard client_id (anonymous)
- before connected
- once connected
- with a valid client_id
- when using a token
- when using a token request with a client_id
- when using basic auth
- deprecated #authorise
- when using JWT
- when using auth_url
- when credentials are valid
- when credentials are wrong
- when token is expired
- when using auth_callback
- when credentials are valid
- when credentials are invalid
- when the client is initialized with ClientOptions and the token is a JWT token
- when credentials are valid
- when credentials are invalid
- when JWT token expires
- client disconnects, a new token is requested via auth_callback and the client gets reconnected
- and an AUTH procol message is received
- when the JWT token request includes a client_id
- when the JWT token request includes a subscribe-only capability
- when using auth_url
- with basic auth
(see spec/acceptance/realtime/channel_history_spec.rb)
- using JSON protocol
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- with a single client publishing and receiving
- with two clients publishing messages on the same channel
- with lots of messages published with a single client and channel
- as one ProtocolMessage
- in multiple ProtocolMessages
- and REST history
- with option until_attach: true
(see spec/acceptance/realtime/channel_spec.rb)
- using JSON protocol
- initialization
- with :auto_connect option set to false on connection
- #attach
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- calls the SafeDeferrable callback on success (#RTL4d)
- when initialized
- emits attaching then attached events
- ignores subsequent #attach calls but calls the success callback if provided
- attaches to a channel
- attaches to a channel and calls the provided block (#RTL4d)
- sends an ATTACH and waits for an ATTACHED (#RTL4c)
- implicitly attaches the channel (#RTL7c)
- when the implicit channel attach fails
- when an ATTACHED acknowledge is not received on the current connection
- when state is :attached
- when state is :failed
- when state is :detaching
- with many connections and many channels on each simultaneously
- failure as a result of insufficient key permissions
- emits failed event (#RTL4e)
- calls the errback of the returned Deferrable (#RTL4d)
- updates the error_reason
- and subsequent authorisation with suitable permissions
- with connection state
- #detach
- when state is :attached
- it detaches from a channel (#RTL5d)
- detaches from a channel and calls the provided block (#RTL5d, #RTL5e)
- emits :detaching then :detached events
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- calls the Deferrable callback on success
- and DETACHED message is not received within realtime request timeout
- when state is :failed
- when state is :attaching
- when state is :detaching
- when state is :suspended
- when state is :initialized
- when state is :detached
- when connection state is
- closing
- failed and channel is failed
- failed and channel is detached
- initialized
- connecting
- disconnected
- when state is :attached
- automatic channel recovery
- when an ATTACH request times out
- if a subsequent ATTACHED is received on an ATTACHED channel
- #publish
- when channel is attached (#RTL6c1)
- when channel is not attached in state Initializing (#RTL6c1)
- when channel is Attaching (#RTL6c1)
- when channel is Detaching (#RTL6c1)
- when channel is Detached (#RTL6c1)
- with :queue_messages client option set to false (#RTL6c4)
- and connection state connected (#RTL6c4)
- and connection state initialized (#RTL6c4)
- and connection state connecting (#RTL6c4)
- and connection state disconnected (#RTL6c4)
- and connection state suspended (#RTL6c4)
- and connection state closing (#RTL6c4)
- and connection state closed (#RTL6c4)
- and the channel state is failed (#RTL6c4)
- with name and data arguments
- publishes the message and return true indicating success
- and additional attributes
- and additional invalid attributes
- with an array of Hash objects with :name and :data attributes
- with an array of Message objects
- publishes an array of messages in one ProtocolMessage
- nil attributes
- when name is nil
- when data is nil
- with neither name or data attributes
- with two invalid message out of 12
- before client_id is known (validated)
- when client_id is known (validated)
- only invalid messages
- before client_id is known (validated)
- when client_id is known (validated)
- with many many messages and many connections simultaneously
- with more than allowed messages in a single publish
- identified clients
- when authenticated with a wildcard client_id
- with a valid client_id in the message
- with a wildcard client_id in the message
- with a non-String client_id in the message
- with an empty client_id in the message
- when authenticated with a Token string with an implicit client_id
- before the client is CONNECTED and the client's identity has been obtained
- with a valid client_id in the message
- with an invalid client_id in the message
- with an empty client_id in the message
- after the client is CONNECTED and the client's identity is known
- with a valid client_id in the message
- with an invalid client_id in the message
- with an empty client_id in the message
- before the client is CONNECTED and the client's identity has been obtained
- when authenticated with a valid client_id
- with a valid client_id
- with a wildcard client_id in the message
- with an invalid client_id in the message
- with an empty client_id in the message
- when anonymous and no client_id
- with a client_id in the message
- with a wildcard client_id in the message
- with an empty client_id in the message
- when authenticated with a wildcard client_id
- #subscribe
- with an event argument
- before attach
- with no event argument
- with a callback that raises an exception
- many times with different event names
- #unsubscribe
- with an event argument
- with no event argument
- when connection state changes to
- :failed
- an :attaching channel
- an :attached channel
- a :detached channel
- a :failed channel
- a channel ATTACH request
- :closed
- an :attached channel
- an :attaching channel (#RTL3b)
- a :detached channel
- a :failed channel
- a channel ATTACH request when connection CLOSED
- a channel ATTACH request when connection CLOSING
- :suspended
- an :attaching channel
- an :attached channel
- a :detached channel
- a :failed channel
- a channel ATTACH request when connection SUSPENDED (#RTL4b)
- :connected
- a :suspended channel
- is automatically reattached (#RTL3d)
- when re-attach attempt fails
- a :suspended channel
- :disconnected
- with an initialized channel
- with an attaching channel
- with an attached channel
- with a detached channel
- with a failed channel
- :failed
- #presence
- channel state change
- emits a ChannelStateChange object
- ChannelStateChange object
- moves to
- when it receives a server-initiated DETACHED (#RTL13)
- and channel is initialized (#RTL13)
- and channel is failed
- and channel is attached
- and channel is suspended
- and channel is attaching
- when it receives an ERROR ProtocolMessage
- initialization
(see spec/acceptance/realtime/channels_spec.rb)
- using JSON protocol
- using shortcut method #channel on the client object
- behaves like a channel
- using #get method on client#channels
- behaves like a channel
- accessing an existing channel object with different options
- accessing an existing channel object without specifying any channel options
- using undocumented array accessor [] method on client#channels
- behaves like a channel
- using shortcut method #channel on the client object
(see spec/acceptance/realtime/client_spec.rb)
- using JSON protocol
- initialization
- basic auth
- is enabled by default with a provided :key option
- with an invalid API key
- :tls option
- set to false to force a plain-text connection
- token auth
- with TLS enabled
- and a pre-generated Token provided with the :token option
- with valid :key and :use_token_auth option set to true
- with client_id
- with TLS disabled
- and a pre-generated Token provided with the :token option
- with valid :key and :use_token_auth option set to true
- with client_id
- with a Proc for the :auth_callback option
- calls the Proc
- uses the token request returned from the callback when requesting a new token
- when the returned token has a client_id
- with a wildcard client_id token
- and an explicit client_id in ClientOptions
- and client_id omitted in ClientOptions
- with an invalid wildcard "*" :client_id
- with TLS enabled
- realtime connection settings
- defaults
- overriden in ClientOptions
- basic auth
- #connection
- #channels
- #auth
- #request (#RSC19*)
- get
- returns an HttpPaginatedResponse object
- 404 request to invalid URL
- paged results
- get
- #publish (#TBC)
- publishing a message implicity connects and publishes the message successfully on the provided channel
- publishing does not result in a channel being created
- publishing supports an array of Message objects
- publishing supports an array of Hash objects
- publishing on a closed connection fails
- with extras
- queue_messages ClientOption
- with more than allowed messages in a single publish
- initialization
(see spec/acceptance/realtime/connection_failures_spec.rb)
- using JSON protocol
- authentication failure
- when API key is invalid
- with invalid app part of the key
- with invalid key name part of the key
- with auth_url
- opening a new connection
- request fails due to network failure
- request fails due to invalid content
- existing CONNECTED connection
- authorize request failure leaves connection in existing condition
- opening a new connection
- with auth_callback
- opening a new connection
- when callback fails due to an exception
- existing CONNECTED connection
- when callback fails due to the request taking longer than realtime_request_timeout
- opening a new connection
- when API key is invalid
- automatic connection retry
- with invalid WebSocket host
- when disconnected
- when connection state is :suspended
- when connection state is :failed
- #error_reason
- #connect
- connection opening times out
- attempts to reconnect
- when retry intervals are stubbed to attempt reconnection quickly
- connection opening times out
- with invalid WebSocket host
- connection resume
- when DISCONNECTED ProtocolMessage received from the server
- reconnects automatically and immediately
- connection state freshness is monitored
- resumes connections when disconnected within the connection_state_ttl period (#RTN15g)
- when connection_state_ttl period has passed since being disconnected
- when connection_state_ttl period has passed since last activity on the connection
- does not clear the local connection state when the connection_state_ttl period has passed since last activity, but the idle timeout has not passed (#RTN15g1, #RTN15g2)
- clears the local connection state and uses a new connection when the connection_state_ttl + max_idle_interval period has passed since last activity (#RTN15g1, #RTN15g2)
- still reattaches the channels automatically following a new connection being established (#RTN15g2)
- and subsequently fails to reconnect
- when websocket transport is abruptly disconnected
- after successfully reconnecting and resuming
- retains connection_id and updates the connection_key (#RTN15e, #RTN16d)
- includes the error received in the connection state change from Ably but leaves the channels attached
- retains channel subscription state
- retains the client_serial (#RTN15c2, #RTN15c3)
- when messages were published whilst the client was disconnected
- when failing to resume
- because the connection_key is not or no longer valid
- updates the connection_id and connection_key
- issue a reattach for all attached channels and fail all message awaiting an ACK (#RTN15c3)
- issue a reattach for all attaching channels and fail all queued messages (#RTN15c3)
- issue a attach for all suspended channels (#RTN15c3)
- sets the error reason on each channel
- resets the client_serial (#RTN15c3)
- as the DISCONNECTED window to resume has passed
- because the connection_key is not or no longer valid
- when an ERROR protocol message is received
- whilst connecting
- with a token error code in the range 40140 <= code < 40150 (#RTN14b)
- with an error code indicating an error other than a token failure (#RTN14g, #RTN15i)
- with no error code indicating an error other than a token failure (#RTN14g, #RTN15i)
- whilst connected
- with a token error code in the range 40140 <= code < 40150 (#RTN14b)
- with an error code indicating an error other than a token failure (#RTN14g, #RTN15i)
- with no error code indicating an error other than a token failure (#RTN14g, #RTN15i)
- whilst connecting
- whilst resuming
- with a token error code in the region 40140 <= code < 40150 (RTN15c5)
- with any other error (#RTN15c4)
- when DISCONNECTED ProtocolMessage received from the server
- fallback host feature
- with custom realtime websocket host option
- with custom realtime websocket port option
- with non-production environment
- does not use a fallback host by default
- :fallback_hosts_use_default is true
- :fallback_hosts array is provided
- with production environment
- when the Internet is down
- when the Internet is up
- and default options
- uses a fallback host + the original host once on every subsequent disconnected attempt until suspended
- uses the primary host when suspended, and then every fallback host and the primary host again on every subsequent suspended attempt
- uses the correct host name for the WebSocket requests to the fallback hosts
- :fallback_hosts array is provided by an empty array
- :fallback_hosts array is provided
- and default options
- authentication failure
(see spec/acceptance/realtime/connection_spec.rb)
- using JSON protocol
- intialization
- connects automatically
- with :auto_connect option set to false
- with token auth
- for renewable tokens
- that are valid for the duration of the test
- with valid pre authorized token expiring in the future
- with implicit authorisation
- that expire
- opening a new connection
- with almost expired tokens
- with immediately expired token
- renews the token on connect, and makes one immediate subsequent attempt to obtain a new token (#RSA4b)
- when disconnected_retry_timeout is 0.5 seconds
- using implicit token auth
- when connected with a valid non-expired token
- that then expires following the connection being opened
- the server
- connection state
- and subsequent token is invalid
- that then expires following the connection being opened
- opening a new connection
- that are valid for the duration of the test
- for non-renewable tokens
- that are expired
- opening a new connection
- when connected
- that are expired
- with opaque token string that contain an implicit client_id
- string
- sets the Client#client_id and Auth#client_id once CONNECTED
- that is incompatible with the current client client_id
- wildcard
- string
- for renewable tokens
- initialization state changes
- with implicit #connect
- with explicit #connect
- #connect
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- calls the Deferrable callback on success
- calls the provided block on success even if state changes to disconnected first
- with invalid auth details
- when already connected
- connection#id
- connection#key
- once connected
- following a previous connection being opened and closed
- when closing
- #serial connection serial
- is set to -1 when a new connection is opened
- is set to 0 when a message is received back
- is set to 1 when the second message is received
- when a message is sent but the ACK has not yet been received
- #close
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- calls the Deferrable callback on success
- when already closed
- when connection state is
- :initialized
- :connected
- #ping
- echoes a heart beat (#RTN13a)
- sends a unique ID in each protocol message (#RTN13e)
- waits until the connection becomes CONNECTED when in the CONNETING state
- with incompatible states
- when not connected
- when suspended
- when failed
- when closed
- when it becomes closed
- with a success block that raises an exception
- when ping times out
- Heartbeats (#RTN23)
- heartbeat interval
- transport-level heartbeats are supported in the websocket transport
- with websocket heartbeats disabled (undocumented)
- #details
- is nil before connected
- contains the ConnectionDetails object once connected (#RTN21)
- contains the new ConnectionDetails object once a subsequent connection is created (#RTN21)
- with a different default connection_state_ttl
- recovery
- #recovery_key
- opening a new connection using a recently disconnected connection's #recovery_key
- connection#id after recovery
- when messages have been sent whilst the old connection is disconnected
- the new connection
- with :recover option
- with invalid syntax
- with invalid formatted value sent to server
- with expired (missing) value sent to server
- with many connections simultaneously
- when a state transition is unsupported
- protocol failure
- receiving an invalid ProtocolMessage
- undocumented method
- #internet_up?
- returns a Deferrable
- internet up URL protocol
- when using TLS for the connection
- when using a non-secured connection
- when the Internet is up
- calls the block with true
- calls the success callback of the Deferrable
- with a TLS connection
- with a non-TLS connection
- when the Internet is down
- #internet_up?
- state change side effects
- when connection enters the :disconnected state
- when connection enters the :suspended state
- when connection enters the :failed state
- connection state change
- emits event to all and single subscribers
- emits a ConnectionStateChange object
- ConnectionStateChange object
- whilst CONNECTED
- when a CONNECTED message is received (#RTN24)
- when a CONNECTED message with an error is received
- version params
- intialization
(see spec/acceptance/realtime/message_spec.rb)
- using JSON protocol
- sends a String data payload
- with supported data payload content type
- JSON Object (Hash)
- JSON Array
- String
- Binary
- with supported extra payload content type (#RTL6h, #RSL6a2)
- JSON Object (Hash)
- JSON Array
- nil
- with unsupported data payload content type
- with ASCII_8BIT message name
- when the message publisher has a client_id
- #connection_id attribute
- over realtime
- when retrieved over REST
- local echo when published
- is enabled by default
- with :echo_messages option set to false
- will not echo messages to the client but will still broadcast messages to other connected clients
- will not echo messages to the client from other REST clients publishing using that connection_key
- will echo messages with a valid connection_id to the client from other REST clients publishing using that connection_key
- publishing lots of messages across two connections
- without suitable publishing permissions
- server incorrectly resends a message that was already received by the client library
- encoding and decoding encrypted messages
- with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)
- item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 1 with encrypted encoding cipher+aes-128-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
- with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d)
- item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 1 with encrypted encoding cipher+aes-256-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
- with multiple sends from one client to another
- subscribing with a different transport protocol
- publishing on an unencrypted channel and subscribing on an encrypted channel with another client
- publishing on an encrypted channel and subscribing on an unencrypted channel with another client
- publishing on an encrypted channel and subscribing with a different algorithm on another client
- publishing on an encrypted channel and subscribing with a different key on another client
- with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)
- when message is published, the connection disconnects before the ACK is received, and the connection is resumed
- when message is published, the connection disconnects before the ACK is received
- the connection is not resumed
- the connection becomes suspended
- the connection becomes failed
- message encoding interoperability
- over a JSON transport
- when decoding string
- when encoding string
- when decoding string
- when encoding string
- when decoding jsonObject
- when encoding jsonObject
- when decoding jsonArray
- when encoding jsonArray
- when decoding binary
- when encoding binary
- over a MsgPack transport
- when publishing a string using JSON protocol
- when retrieving a string using JSON protocol
- when publishing a string using JSON protocol
- when retrieving a string using JSON protocol
- when publishing a jsonObject using JSON protocol
- when retrieving a jsonObject using JSON protocol
- when publishing a jsonArray using JSON protocol
- when retrieving a jsonArray using JSON protocol
- when publishing a binary using JSON protocol
- when retrieving a binary using JSON protocol
- over a JSON transport
(see spec/acceptance/realtime/presence_history_spec.rb)
- using JSON protocol
(see spec/acceptance/realtime/presence_spec.rb)
- using JSON protocol
- when attached (but not present) on a presence channel with an anonymous client (no client ID)
- #sync_complete? and SYNC flags (#RTP1)
- when attaching to a channel without any members present
- when attaching to a channel with members present
- 101 existing (present) members on a channel (2 SYNC pages)
- requiring at least 2 SYNC ProtocolMessages
- when a client attaches to the presence channel
- emits :present for each member
- and a member enters before the SYNC operation is complete
- and a member leaves before the SYNC operation is complete
- emits :leave immediately as the member leaves and cleans up the ABSENT member after (#RTP2f, #RTP2g)
- ignores presence events with timestamps / identifiers prior to the current :present event in the MembersMap (#RTP2c)
- does not emit :present after the :leave event has been emitted, and that member is not included in the list of members via #get (#RTP2f)
- #get
- by default
- with :wait_for_sync option set to false (#RTP11c1)
- when a client attaches to the presence channel
- requiring at least 2 SYNC ProtocolMessages
- state
- #enter
- data attribute
- when provided as argument option to #enter
- message #connection_id
- without necessary capabilities to join presence
- it should behave like a public presence method
- raise an exception if the channel is detached
- raise an exception if the channel becomes detached
- raise an exception if the channel is failed
- raise an exception if the channel becomes failed
- implicitly attaches the channel
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- allows a block to be passed in that is executed upon success
- calls the Deferrable callback on success
- catches exceptions in the provided method block and logs them to the logger
- when :queue_messages client option is false
- and connection state initialized
- and connection state connecting
- and connection state disconnected
- and connection state connected
- with supported data payload content type
- JSON Object (Hash)
- JSON Array
- String
- Binary
- with unsupported data payload content type
- if connection fails before success
- data attribute
- #update
- without previous #enter automatically enters
- updates the data if :data argument provided
- updates the data to nil if :data argument is not provided (assumes nil value)
- when ENTERED
- it should behave like a public presence method
- raise an exception if the channel is detached
- raise an exception if the channel becomes detached
- raise an exception if the channel is failed
- raise an exception if the channel becomes failed
- implicitly attaches the channel
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- allows a block to be passed in that is executed upon success
- calls the Deferrable callback on success
- catches exceptions in the provided method block and logs them to the logger
- when :queue_messages client option is false
- and connection state initialized
- and connection state connecting
- and connection state disconnected
- and connection state connected
- with supported data payload content type
- JSON Object (Hash)
- JSON Array
- String
- Binary
- with unsupported data payload content type
- if connection fails before success
- #leave
- succeeds and does not emit an event (#RTP10d)
- :data option
- when set to a string
- when set to nil
- when not passed as an argument (i.e. nil)
- and sync is complete
- it should behave like a public presence method
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- allows a block to be passed in that is executed upon success
- calls the Deferrable callback on success
- catches exceptions in the provided method block and logs them to the logger
- with supported data payload content type
- JSON Object (Hash)
- JSON Array
- String
- Binary
- with unsupported data payload content type
- if connection fails before success
- :left event
- entering/updating/leaving presence state on behalf of another client_id
- #enter_client
- multiple times on the same channel with different client_ids
- message #connection_id
- without necessary capabilities to enter on behalf of another client
- it should behave like a public presence method
- raise an exception if the channel is detached
- raise an exception if the channel becomes detached
- raise an exception if the channel is failed
- raise an exception if the channel becomes failed
- implicitly attaches the channel
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- allows a block to be passed in that is executed upon success
- calls the Deferrable callback on success
- catches exceptions in the provided method block and logs them to the logger
- when :queue_messages client option is false
- and connection state initialized
- and connection state connecting
- and connection state disconnected
- and connection state connected
- with supported data payload content type
- JSON Object (Hash)
- JSON Array
- String
- Binary
- with unsupported data payload content type
- if connection fails before success
- it should behave like a presence on behalf of another client method
- :enter_client when authenticated with a wildcard client_id
- and a valid client_id
- and a wildcard client_id
- and an empty client_id
- and a client_id that is not a string type
- :enter_client when authenticated with a valid client_id
- and another invalid client_id
- before authentication
- after authentication
- and a wildcard client_id
- and an empty client_id
- and another invalid client_id
- :enter_client when anonymous and no client_id
- and another invalid client_id
- before authentication
- after authentication
- and a wildcard client_id
- and an empty client_id
- and another invalid client_id
- :enter_client when authenticated with a wildcard client_id
- #update_client
- multiple times on the same channel with different client_ids
- it should behave like a public presence method
- raise an exception if the channel is detached
- raise an exception if the channel becomes detached
- raise an exception if the channel is failed
- raise an exception if the channel becomes failed
- implicitly attaches the channel
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- allows a block to be passed in that is executed upon success
- calls the Deferrable callback on success
- catches exceptions in the provided method block and logs them to the logger
- when :queue_messages client option is false
- and connection state initialized
- and connection state connecting
- and connection state disconnected
- and connection state connected
- with supported data payload content type
- JSON Object (Hash)
- JSON Array
- String
- Binary
- with unsupported data payload content type
- if connection fails before success
- it should behave like a presence on behalf of another client method
- :update_client when authenticated with a wildcard client_id
- and a valid client_id
- and a wildcard client_id
- and an empty client_id
- and a client_id that is not a string type
- :update_client when authenticated with a valid client_id
- and another invalid client_id
- before authentication
- after authentication
- and a wildcard client_id
- and an empty client_id
- and another invalid client_id
- :update_client when anonymous and no client_id
- and another invalid client_id
- before authentication
- after authentication
- and a wildcard client_id
- and an empty client_id
- and another invalid client_id
- :update_client when authenticated with a wildcard client_id
- #leave_client
- leaves a channel
- multiple times on the same channel with different client_ids
- with a new value in :data option
- with a nil value in :data option
- with no :data option
- it should behave like a public presence method
- raise an exception if the channel is detached
- raise an exception if the channel becomes detached
- raise an exception if the channel is failed
- raise an exception if the channel becomes failed
- implicitly attaches the channel
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- allows a block to be passed in that is executed upon success
- calls the Deferrable callback on success
- catches exceptions in the provided method block and logs them to the logger
- when :queue_messages client option is false
- and connection state initialized
- and connection state connecting
- and connection state disconnected
- and connection state connected
- with supported data payload content type
- JSON Object (Hash)
- JSON Array
- String
- Binary
- with unsupported data payload content type
- if connection fails before success
- it should behave like a presence on behalf of another client method
- :leave_client when authenticated with a wildcard client_id
- and a valid client_id
- and a wildcard client_id
- and an empty client_id
- and a client_id that is not a string type
- :leave_client when authenticated with a valid client_id
- and another invalid client_id
- before authentication
- after authentication
- and a wildcard client_id
- and an empty client_id
- and another invalid client_id
- :leave_client when anonymous and no client_id
- and another invalid client_id
- before authentication
- after authentication
- and a wildcard client_id
- and an empty client_id
- and another invalid client_id
- :leave_client when authenticated with a wildcard client_id
- leaves a channel
- #enter_client
- #get
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- calls the Deferrable callback on success
- catches exceptions in the provided method block
- implicitly attaches the channel (#RTP11b)
- fails if the connection is DETACHED (#RTP11b)
- fails if the connection is FAILED (#RTP11b)
- returns the current members on the channel (#RTP11a)
- filters by connection_id option if provided (#RTP11c3)
- filters by client_id option if provided (#RTP11c2)
- does not wait for SYNC to complete if :wait_for_sync option is false (#RTP11c1)
- returns the list of members and waits for SYNC to complete by default (#RTP11a)
- when the channel is SUSPENDED
- during a sync
- when :wait_for_sync is true
- when a member enters and then leaves
- when a member enters and the presence map is updated
- with lots of members on different clients
- #subscribe
- implicitly attaches
- with no arguments
- with event name
- with a callback that raises an exception
- #unsubscribe
- with no arguments
- with event name
- REST #get
- client_id with ASCII_8BIT
- in connection set up
- in channel options
- encoding and decoding of presence message data
- encrypts presence message data
- #subscribe
- #get
- REST #get
- when cipher settings do not match publisher
- leaving
- connection failure mid-way through a large member sync
- server-initiated sync
- with multiple SYNC pages
- with a single SYNC page
- when members exist in the PresenceMap before a SYNC completes
- when the client does not have presence subscribe privileges but is present on the channel
- local PresenceMap for presence members entered by this client
- maintains a copy of the member map for any member that shares this connection's connection ID (#RTP17)
- when a channel becomes attached again
- and the resume flag is true
- and the presence flag is false
- and the presence flag is true
- and following the SYNC all local MemberMap members are present in the PresenceMap
- and following the SYNC a local MemberMap member is not present in the PresenceMap
- and the resume flag is false
- and the presence flag is false
- when re-entering a client automatically, if the re-enter fails for any reason
- and the resume flag is true
- channel state side effects
- channel transitions to the FAILED state
- channel transitions to the DETACHED state
- channel transitions to the SUSPENDED state
(see spec/acceptance/realtime/push_admin_spec.rb)
- using JSON protocol
- #publish
- returns a SafeDeferrable that catches exceptions in callbacks and logs them
- accepts valid push data and recipient
- invalid arguments
- invalid recipient
- invalid push data
- recipient variable case
- using test environment channel recipient (#RSH1a)
- #device_registrations
- without permissions
- #list
- #get
- #save
- saves the new DeviceDetails Hash object
- with a failed request
- #remove_where
- #remove
- #channel_subscriptions
- #list
- #list_channels
- #save
- #remove_where
- #remove
- #publish
(see spec/acceptance/realtime/push_spec.rb)
- using JSON protocol
- #activate
- #deactivate
(see spec/acceptance/realtime/stats_spec.rb)
- using JSON protocol
(see spec/acceptance/realtime/time_spec.rb)
- using JSON protocol
- fetching the service time
(see spec/acceptance/rest/auth_spec.rb)
- using JSON protocol
- has immutable options
- #request_token
- creates a TokenRequest automatically and sends it to Ably to obtain a token
- returns a valid TokenDetails object in the expected format with valid issued and expires attributes
- with token_param :client_id
- with token_param :capability
- with token_param :nonce
- with token_param :timestamp
- with token_param :ttl
- with :key option
- with :key_name & :key_secret options
- with :query_time option
- without :query_time option
- with :auth_url option merging
- with existing configured auth options
- using unspecified :auth_method
- requests a token using a GET request with provided headers, and merges client_id into auth_params
- with provided token_params
- with provided auth option auth_params and auth_headers
- using :get :auth_method and query params in the URL
- using :post :auth_method
- using unspecified :auth_method
- with existing configured auth options
- with :auth_url option
- when response from :auth_url is a valid token request
- requests a token from :auth_url using an HTTP GET request
- returns a valid token generated from the token request
- with :query_params
- with :headers
- with POST
- when response from :auth_url is a token details object
- when response from :auth_url is text/plain content type and a token string
- when response is invalid
- when response from :auth_url is a valid token request
- with a Proc for the :auth_callback option
- that returns a TokenRequest
- that returns a TokenDetails JSON object
- that returns a TokenDetails object
- that returns a Token string
- with auth_option :client_id
- with token_param :client_id
- before #authorize has been called
- #authorize (#RSA10, #RSA10j)
- updates the persisted token params that are then used for subsequent authorize requests
- updates the persisted auth options that are then used for subsequent authorize requests
- when called for the first time since the client has been instantiated
- query_time: true with authorize
- query_time: true ClientOption when instanced
- TokenParams argument
- has no effect on the defaults when null and TokenParam defaults remain the same
- updates defaults when present and all previous configured TokenParams are discarded (#RSA10g)
- updates Auth#token_params attribute with an immutable hash
- uses TokenParams#timestamp for this request but obtains a new timestamp for subsequence requests (#RSA10g)
- AuthOptions argument
- has no effect on the defaults when null and AuthOptions defaults remain the same
- updates defaults when present and all previous configured AuthOptions are discarded (#RSA10g)
- updates Auth#options attribute with an immutable hash
- uses AuthOptions#query_time for this request and will not query_time for subsequent requests (#RSA10g)
- uses AuthOptions#query_time for this request and will query_time again if provided subsequently
- with previous authorisation
- with a lambda for the :auth_callback option
- calls the lambda
- uses the token request returned from the callback when requesting a new token
- for every subsequent #request_token
- without a :auth_callback lambda
- with a provided block
- with an explicit token string that expires
- and a lambda for the :auth_callback option to provide a means to renew the token
- with an explicit ClientOptions client_id
- and an incompatible client_id in a TokenDetails object passed to the auth callback
- and an incompatible client_id in a TokenRequest object passed to the auth callback and raises an exception
- and a token string without any retrievable client_id
- #create_token_request
- returns a TokenRequest object
- returns a TokenRequest that can be passed to a client that can use it for authentication without an API key
- uses the key name from the client
- specifies no TTL (#RSA5)
- specifies no capability (#RSA6)
- with a :ttl option below the Token expiry buffer that ensures tokens are renewed 15s before they expire as they are considered expired
- the nonce
- with token param :ttl
- with token param :nonce
- with token param :client_id
- when specifying capability
- with additional invalid attributes
- when required fields are missing
- timestamp attribute
- is a Time object in Ruby and is set to the local time
- with :query_time auth_option
- with :timestamp option
- signing
- generates a valid HMAC
- lexicographic ordering of channels and operations
- using token authentication
- with :token option
- when implicit as a result of using :client_id
- and requests to the Ably server are mocked
- a token is created
- when token expires
- when :client_id is provided in a token
- #client_id_validated?
- when using basic auth
- when using a token auth string for a token with a client_id
- when using a token
- when using a token request with a client_id
- when using a :key and basic auth
- deprecated #authorise
- when using JWT
- authenticates correctly using the JWT token generated by the echo server
- when the JWT embeds an Ably token
- authenticates correctly using the embedded token
- and the requested token is encrypted
- when the token requested is returned with application/jwt content type
(see spec/acceptance/rest/base_spec.rb)
- transport protocol
- when protocol is not defined it defaults to :msgpack
- when option {:protocol=>:json} is used
- when option {:use_binary_protocol=>false} is used
- when option {:protocol=>:msgpack} is used
- when option {:use_binary_protocol=>true} is used
- using JSON protocol
- failed requests
- due to invalid Auth
- server error with JSON error response body
- 500 server error without a valid JSON response body
- token authentication failures
- when auth#token_renewable?
- when NOT auth#token_renewable?
- failed requests
(see spec/acceptance/rest/channel_spec.rb)
- using JSON protocol
- #publish
- with name and data arguments
- with a client_id configured in the ClientOptions
- with an array of Hash objects with :name and :data attributes
- with an array of Message objects
- without adequate permissions on the channel
- null attributes
- when name is null
- when data is null
- with neither name or data attributes
- identified clients
- when authenticated with a wildcard client_id
- with a valid client_id in the message
- with a wildcard client_id in the message
- with an empty client_id in the message
- when authenticated with a Token string with an implicit client_id
- without having a confirmed identity
- with a valid client_id in the message
- with an invalid client_id in the message
- with an empty client_id in the message
- without having a confirmed identity
- when authenticated with TokenDetails with a valid client_id
- with a valid client_id in the message
- with a wildcard client_id in the message
- with an invalid client_id in the message
- with an empty client_id in the message
- when anonymous and no client_id
- with a client_id in the message
- with a wildcard client_id in the message
- with an empty client_id in the message
- when authenticated with a wildcard client_id
- with a non ASCII channel name
- #history
- returns a PaginatedResult model
- returns the current message history for the channel
- returns paged history using the PaginatedResult model
- message timestamps
- message IDs
- direction
- limit
- #history option
- :start
- with milliseconds since epoch value
- with a Time object value
- :end
- with milliseconds since epoch value
- with a Time object value
- when argument start is after end
- :start
- #presence
- #publish
(see spec/acceptance/rest/channels_spec.rb)
- using JSON protocol
- using shortcut method #channel on the client object
- behaves like a channel
- using #get method on client#channels
- behaves like a channel
- accessing an existing channel object with different options
- accessing an existing channel object without specifying any channel options
- using undocumented array accessor [] method on client#channels
- behaves like a channel
- using shortcut method #channel on the client object
(see spec/acceptance/rest/client_spec.rb)
- using JSON protocol
- #initialize
- with only an API key
- with an invalid API key
- with an explicit string :token
- with :use_token_auth set to true
- with a :client_id configured
- with a non string :client_id
- with an invalid wildcard "*" :client_id
- with an :auth_callback lambda
- with :default_token_params
- with an :auth_callback lambda (clientId provided in library options instead of as a token_request param)
- with an auth URL
- uses token authentication
- before any REST request
- auth headers
- with basic auth
- with token auth
- without specifying protocol
- when setting constructor ClientOption :tls to false
- using tokens
- when expired
- creates a new token automatically when the old token expires
- with a different client_id in the subsequent token
- when token has not expired
- when expired
- connection transport
- defaults
- with custom http_open_timeout and http_request_timeout options
- fallback hosts
- configured
- when environment is NOT production (#RSC15b)
- when environment is production
- and connection times out
- tries fallback hosts 3 times (#RSC15b, #RSC15b)
- and the total request time exeeds 15 seconds
- and connection fails
- and first request to primary endpoint fails
- and basic authentication fails
- and server returns a 50x error
- and connection times out
- when environment is production and server returns a 50x error
- with custom fallback hosts provided
- with an empty array of fallback hosts provided (#RSC15b, #RSC15a, #TO3k6)
- using a local web-server
- and timing out the primary host
- POST with request timeout less than max_retry_duration
- GET with request timeout less than max_retry_duration
- POST with request timeout more than max_retry_duration
- GET with request timeout more than max_retry_duration
- and failing the primary host
- to fail the primary host, allow a fallback to succeed, then later trigger a fallback to the primary host (#RSC15f)
- succeeds and remembers fallback host preferences across requests
- with custom :fallback_retry_timeout
- and timing out the primary host
- when environment is not production and server returns a 50x error
- with custom fallback hosts provided (#RSC15b, #TO3k6)
- with an empty array of fallback hosts provided (#RSC15b, #TO3k6)
- with fallback_hosts_use_default: true (#RSC15b, #TO3k7)
- with a custom host
- that does not exist
- fails immediately and raises a Faraday Error
- fallback hosts
- that times out
- fails immediately and raises a Faraday Error
- fallback hosts
- that does not exist
- HTTP configuration options
- is frozen
- defaults
- configured
- #auth
- version headers
- with variant none
- with variant foo
- #request (#RSC19*)
- get
- returns an HttpPaginatedResponse object
- 404 request to invalid URL
- paged results
- get
- request_id generation
- Timeout error
- with option add_request_ids: true
- with option add_request_ids: true and REST operations with a message body
- with mocks to inspect the params
- with a single publish
- with an array publish
- without mocks to ensure the requests are accepted
- with a single publish
- with an array publish
- with mocks to inspect the params
- option add_request_ids: true and specified fallback hosts
- without request_id
- UnauthorizedRequest nonce error
- Timeout error
- failed request logging
- is absent when requests do not fail
- with the first request failing
- with all requests failing
- #initialize
(see spec/acceptance/rest/encoders_spec.rb)
- with binary transport protocol
- without encryption
- with UTF-8 data
- with binary data
- with JSON data
- with encryption
- with UTF-8 data
- with binary data
- with JSON data
- without encryption
- with text transport protocol
- without encryption
- with UTF-8 data
- with binary data
- with JSON data
- with encryption
- with UTF-8 data
- with binary data
- with JSON data
- without encryption
(see spec/acceptance/rest/message_spec.rb)
- using JSON protocol
- publishing with an ASCII_8BIT message name
- with supported data payload content type
- JSON Object (Hash)
- JSON Array
- String
- Binary
- with supported extra payload content type (#RSL1h, #RSL6a2)
- JSON Object (Hash)
- JSON Array
- nil
- idempotency (#RSL1k)
- idempotent publishing is disabled by default with 1.1 (#TO3n)
- idempotent publishing is enabled by default with 1.2 (#TO3n)
- when ID is not included (#RSL1k2)
- with Message object
- with #publish arguments only
- when ID is included (#RSL1k2, #RSL1k5)
- the ID provided is used for the published messages
- PENDING: for multiple messages in one publish operation (#RSL1k3)
- PENDING: for multiple messages in one publish operation with IDs following the required format described in RSL1k1 (#RSL1k3)
- with Message object
- with #publish arguments only
- when idempotent publishing is enabled in the client library ClientOptions (#TO3n)
- the ID is populated with a random ID and serial 0 from this lib (#RSL1k1)
- when there is a network failure triggering an automatic retry (#RSL1k4)
- PENDING: for multiple messages in one publish operation
- with Message object
- with #publish arguments only
- with explicitly provided message ID
- when publishing a batch of messages
- with unsupported data payload content type
- encryption and encoding
- with #publish and #history
- with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)
- item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 1 with encrypted encoding cipher+aes-128-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
- with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d)
- item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 1 with encrypted encoding cipher+aes-256-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
- behaves like an Ably encrypter and decrypter
- item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
- when publishing lots of messages
- when retrieving #history with a different protocol
- when publishing on an unencrypted channel and retrieving with #history on an encrypted channel
- when publishing on an encrypted channel and retrieving with #history on an unencrypted channel
- publishing on an encrypted channel and retrieving #history with a different algorithm on another client (#RTL7e)
- publishing on an encrypted channel and subscribing with a different key on another client
- with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)
- with #publish and #history
(see spec/acceptance/rest/presence_spec.rb)
- using JSON protocol
- tested against presence fixture data set up in test app
- #get
- returns current members on the channel with their action set to :present
- with :limit option
- default :limit
- with :client_id option
- with :connection_id option
- with a non ASCII channel name
- #history
- returns recent presence activity
- default behaviour
- with options
- direction: :forwards
- direction: :backwards
- #get
- #history
- with options
- limit options
- default
- set to 1000
- with time range options
- :start
- with milliseconds since epoch value
- with Time object value
- :end
- with milliseconds since epoch value
- with Time object value
- when argument start is after end
- :start
- limit options
- with options
- decoding
- with encoded fixture data
- decoding permutations using mocked #history
- valid decodeable content
- invalid data
- tested against presence fixture data set up in test app
(see spec/acceptance/rest/push_admin_spec.rb)
- using JSON protocol
- #publish
- accepts valid push data and recipient (#RSH1a)
- without publish permissions
- invalid arguments (#RHS1a)
- invalid recipient (#RSH1a)
- invalid push data (#RSH1a)
- recipient variable case
- using test environment channel recipient (#RSH1a)
- #device_registrations (#RSH1b)
- without permissions
- #list (#RSH1b2)
- #get (#RSH1b1)
- #save (#RSH1b3)
- #remove_where (#RSH1b5)
- #remove (#RSH1b4)
- #channel_subscriptions (#RSH1c)
- #list (#RSH1c1)
- #list_channels (#RSH1c2)
- #save (#RSH1c3)
- #remove_where (#RSH1c5)
- #remove (#RSH1c4)
- #publish
(see spec/acceptance/rest/push_spec.rb)
- using JSON protocol
- #activate
- #deactivate
(see spec/acceptance/rest/stats_spec.rb)
- using JSON protocol
- fetching application stats
- returns a PaginatedResult object
- by minute
- with no options
- with :from set to last interval and :limit set to 1
- retrieves only one stat
- returns zero value for any missing metrics
- returns all aggregated message data
- returns inbound realtime all data
- returns inbound realtime message data
- returns outbound realtime all data
- returns persisted presence all data
- returns connections all data
- returns channels all data
- returns api_requests data
- returns token_requests data
- returns stat objects with #interval_granularity equal to :minute
- returns stat objects with #interval_id matching :start
- returns stat objects with #interval_time matching :start Time
- with :start set to first interval, :limit set to 1 and direction :forwards
- with :end set to last interval, :limit set to 1 and direction :backwards
- with :end set to last interval and :limit set to 3 to ensure only last years stats are included
- the REST API
- with :end set to previous year interval
- the REST API
- by hour
- by day
- by month
- when argument start is after end
- fetching application stats
(see spec/acceptance/rest/time_spec.rb)
- using JSON protocol
- fetching the service time
- should return the service time as a Time object
- with reconfigured HTTP timeout
- fetching the service time
(see spec/unit/auth_spec.rb)
- client_id option
- with nil value
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- defaults
(see spec/unit/logger_spec.rb)
- uses the language provided Logger by default
- with a custom Logger
- with an invalid interface
- with a valid interface
- with blocks
- does not call the block unless the log level is met
- with an exception in the logger block
(see spec/unit/models/auth_details_spec.rb)
- behaves like a model
- attributes
- #access_token
- #==
- is immutable
- attributes
- ==
(see spec/unit/models/channel_state_change_spec.rb)
- #current (#TH1)
- #previous (#TH2)
- #event (#TH5)
- #reason (#TH3)
- #resumed (#TH4)
- invalid attributes
(see spec/unit/models/cipher_params_spec.rb)
- :key missing from constructor
- #key
- with :key in constructor
- as nil
- as a base64 encoded string
- as a URL safe base64 encoded string
- as a binary encoded string
- with an incompatible :key_length constructor param
- with an unsupported :key_length for aes-cbc encryption
- with an invalid type
- with :key in constructor
- with specified params in the constructor
- #cipher_type
- #mode
- #algorithm
- #key_length
- with combined param in the constructor
- #cipher_type
- #mode
- #algorithm
- #key_length
(see spec/unit/models/connection_details_spec.rb)
- behaves like a model
- attributes
- #client_id
- #connection_key
- #max_message_size
- #max_frame_size
- #max_inbound_rate
- #==
- is immutable
- attributes
- attributes
- #connection_state_ttl (#CD2f)
- #max_idle_interval (#CD2h)
- ==
(see spec/unit/models/connection_state_change_spec.rb)
- #current (#TA2)
- #previous(#TA2)
- #event(#TA5)
- #retry_in (#TA2)
- #reason (#TA3)
- invalid attributes
(see spec/unit/models/device_details_spec.rb)
- #id and #id=
- #platform and #platform=
- #form_factor and #form_factor=
- #client_id and #client_id=
- #device_secret and #device_secret=
- camelCase constructor attributes
- #metadata and #metadata=
- #push and #push=
(see spec/unit/models/device_push_details_spec.rb)
- #state and #state=
- camelCase constructor attributes
- #recipient and #recipient=
- #error_reason and #error_reason=
(see spec/unit/models/error_info_spec.rb)
- #TI1, #TI4
- behaves like a model
- attributes
- #code
- #status_code
- #href
- #message
- #==
- is immutable
- attributes
- behaves like a model
- #status #TI1, #TI2
- log entries container help link #TI5
- without an error code
- with a specified error code
- with an error code and an href attribute
- with an error code and a message with the same error URL
- with an error code and a message with a different error URL
(see spec/unit/models/http_paginated_result_spec.rb)
- #items
- with non paged http response
- with paged http response
- has next page
- is not the last page
- supports pagination
- accessing next page
- response metadata
- #items Array conversion and nil handling #HP3
- with Json Array
- with Json Object
- with empty response
- with nil response
(see spec/unit/models/message_encoders/base64_spec.rb)
- #decode
- message with base64 payload
- message with base64 payload before other payloads
- message with another payload
- #encode
- over binary transport
- message with binary payload
- already encoded message with binary payload
- message with UTF-8 payload
- message with nil payload
- message with empty binary string payload
- over text transport
- message with binary payload
- already encoded message with binary payload
- message with UTF-8 payload
- message with nil payload
- over binary transport
(see spec/unit/models/message_encoders/cipher_spec.rb)
- #decode
- with channel set up for AES-128-CBC
- valid cipher data
- message with cipher payload
- message with cipher payload before other payloads
- message with binary payload
- message with another payload
- 256 bit key
- with invalid channel_option cipher params
- without any configured encryption
- with invalid cipher data
- valid cipher data
- with AES-256-CBC
- message with cipher payload
- with channel set up for AES-128-CBC
- #encode
- with channel set up for AES-128-CBC
- with encrypted set to true
- message with string payload
- message with binary payload
- message with json payload
- message with existing cipher encoding before
- with encryption set to to false
- channel_option cipher params
- have invalid key length
- have invalid algorithm
- have missing key
- with encrypted set to true
- with AES-256-CBC
- message with cipher payload
- with channel set up for AES-128-CBC
(see spec/unit/models/message_encoders/json_spec.rb)
- #decode
- message with json payload
- message with json payload in camelCase
- message with json payload before other payloads
- message with another payload
- #encode
- message with hash payload
- message with hash payload and underscore case keys
- already encoded message with hash payload
- message with Array payload
- message with UTF-8 payload
- message with nil payload
- message with no data payload
(see spec/unit/models/message_encoders/utf8_spec.rb)
- #decode
- message with utf8 payload
- message with utf8 payload before other payloads
- message with another payload
(see spec/unit/models/message_spec.rb)
- serialization of the Message object (#RSL1j)
- behaves like a model
- attributes
- #id
- #name
- #client_id
- #data
- #encoding
- #==
- is immutable
- attributes
- behaves like a model
- #id (#RSL1j)
- #timestamp
- #extras (#TM2i)
- when missing
- when a string
- when a Hash
- when a Json Array
- #connection_id attribute
- when this model has a connectionId attribute
- but no protocol message
- with a protocol message with a different connectionId
- when this model has no connectionId attribute
- and no protocol message
- with a protocol message with a connectionId
- when this model has a connectionId attribute
- initialized with
- :name
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- :client_id
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- :encoding
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- :name
- #from_encoded (#TM3)
- with no encoding
- returns a message object
- with a block
- with an encoding
- with a custom encoding
- with a Cipher encoding
- with invalid Cipher encoding
- without a block
- with a block
- with no encoding
- #from_encoded_array (#TM3)
- with no encoding
(see spec/unit/models/paginated_result_spec.rb)
- #items
- with non paged http response
- with paged http response
- has next page
- is not the last page
- supports pagination
- accessing next page
(see spec/unit/models/presence_message_spec.rb)
- behaves like a model
- attributes
- #id
- #client_id
- #data
- #encoding
- #==
- is immutable
- attributes
- #connection_id attribute
- when this model has a connectionId attribute
- but no protocol message
- with a protocol message with a different connectionId
- when this model has no connectionId attribute
- and no protocol message
- with a protocol message with a connectionId
- when this model has a connectionId attribute
- #member_key attribute
- is string in format connection_id:client_id
- with the same client id across multiple connections
- with a single connection and different client_ids
- #timestamp
- initialized with
- :client_id
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- :connection_id
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- :encoding
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- :client_id
- #from_encoded (#TP4)
- with no encoding
- returns a presence message object
- with a block
- with an encoding
- with a custom encoding
- with a Cipher encoding
- with invalid Cipher encoding
- without a block
- with a block
- with no encoding
- #from_encoded_array (#TP4)
- with no encoding
- #shallow_clone
- with inherited attributes from ProtocolMessage
- with embedded attributes for all fields
- with new attributes passed in to the method
- creates a duplicate of the message without any ProtocolMessage dependency
- with an invalid ProtocolMessage (missing an ID)
- with mixing of cases
(see spec/unit/models/protocol_message_spec.rb)
- behaves like a model
- attributes
- #id
- #channel
- #channel_serial
- #connection_id
- #connection_key
- #==
- is immutable
- attributes
- attributes
- #timestamp
- #count
- when missing
- when non numeric
- when greater than 1
- #message_serial
- #has_message_serial?
- without msg_serial
- with msg_serial
- #connection_serial
- #flags (#TR4i)
- when nil
- when numeric
- when presence flag present
- when channel resumed flag present
- when channel resumed and presence flags present
- when has another future flag
- #has_connection_serial?
- without connection_serial
- with connection_serial
- #serial
- with underlying msg_serial
- with underlying connection_serial
- with underlying connection_serial and msg_serial
- #has_serial?
- without msg_serial or connection_serial
- with msg_serial
- with connection_serial
- #error
- with no error attribute
- with nil error
- with error
- #messages (#TR4k)
- #presence (#TR4l)
- #connection_details (#TR4o)
- with a JSON value
- without a JSON value
- #auth (#TR4p)
- with a JSON value
- without a JSON value
- #connection_key (#TR4e)
- existing only in #connection_details.connection_key
- existing in both #connection_key and #connection_details.connection_key
(see spec/unit/models/push_channel_subscription_spec.rb)
- #channel and #channel=
- #client_id and #client_id=
- #device_id and #device_id=
- camelCase constructor attributes
- conversion method PushChannelSubscription
- #for_client_id constructor
- with a valid object
- with an invalid valid object
(see spec/unit/models/stats_spec.rb)
- #all stats
- #persisted stats
- #inbound stats
- #outbound stats
- #connections stats
- #channels stats
- #api_requests stats
- #token_requests stats
- #interval_granularity
- #interval_time
- class methods
- #to_interval_id
- when time zone of time argument is UTC
- converts time 2014-02-03:05:06 with granularity :month into 2014-02
- converts time 2014-02-03:05:06 with granularity :day into 2014-02-03
- converts time 2014-02-03:05:06 with granularity :hour into 2014-02-03:05
- converts time 2014-02-03:05:06 with granularity :minute into 2014-02-03:05:06
- fails with invalid granularity
- fails with invalid time
- when time zone of time argument is +02:00
- when time zone of time argument is UTC
- #from_interval_id
- converts a month interval_id 2014-02 into a Time object in UTC 0
- converts a day interval_id 2014-02-03 into a Time object in UTC 0
- converts an hour interval_id 2014-02-03:05 into a Time object in UTC 0
- converts a minute interval_id 2014-02-03:05:06 into a Time object in UTC 0
- fails with an invalid interval_id 14-20
- #granularity_from_interval_id
- #to_interval_id
(see spec/unit/models/token_details_spec.rb)
- behaves like a model
- attributes
- #token
- #key_name
- #client_id
- #==
- is immutable
- attributes
- attributes
- #capability
-
- #issued with :issued option as milliseconds in constructor
- #issued with :issued option as a Time in constructor
- #issued when converted to JSON
- #expires with :expires option as milliseconds in constructor
- #expires with :expires option as a Time in constructor
- #expires when converted to JSON
- #expired?
- once grace period buffer has passed
- within grace period buffer
- when expires is not available (i.e. string tokens)
- ==
- to_json
- with all attributes and values
- with only a token string
- from_json (#TD7)
- with Ruby idiomatic Hash object
- with JSON-like object
- with JSON string
(see spec/unit/models/token_request_spec.rb)
- behaves like a model
- attributes
- #key_name
- #client_id
- #nonce
- #mac
- #==
- is immutable
- attributes
- attributes
- #capability
- #timestamp
- with :timestamp option as milliseconds in constructor
- with :timestamp option as Time in constructor
- when converted to JSON
- #ttl
- with :ttl option as milliseconds in constructor
- when converted to JSON
- ==
- from_json (#TE6)
- with Ruby idiomatic Hash object
- with JSON-like object
- with JSON string
(see spec/unit/modules/event_emitter_spec.rb)
- #emit event fan out
- should emit an event for any number of subscribers
- sends only messages to matching event names
- #on subscribe to multiple events
- event callback changes within the callback block
- when new event callbacks are added
- when callbacks are removed
- #on (#RTE3)
- #once (#RTE4)
- with event specified
- with no event specified
- #unsafe_once
- #off
- with event specified in on handler
- with event names as arguments
- without any event names
- when on callback is configured for all events
- with event names as arguments
- without any event names
- with unsafe_on subscribers
- with unsafe_once subscribers
- with event specified in on handler
- #unsafe_off
- with unsafe_on subscribers
- with unsafe_once subscribers
- with on subscribers
- with once subscribers
(see spec/unit/modules/state_emitter_spec.rb)
- #state returns current state
- #state= sets current state
- #change_state sets current state
- #change_state with arguments
- #state?
(see spec/unit/realtime/channel_spec.rb)
- #initializer
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- #publish name argument
- as UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- callbacks
- subscriptions
- #subscribe
- without a block raises an invalid ArgumentError
- with no event name specified subscribes the provided block to all events
- with a single event name subscribes that block to matching events
- with a multiple event name arguments subscribes that block to all of those event names
- with a multiple duplicate event name arguments subscribes that block to all of those unique event names once
- #unsubscribe
- with no event name specified unsubscribes that block from all events
- with a single event name argument unsubscribes the provided block with the matching event name
- with multiple event name arguments unsubscribes each of those matching event names with the provided block
- with a non-matching event name argument has no effect
- with no block argument unsubscribes all blocks for the event name argument
- #subscribe
(see spec/unit/realtime/channels_spec.rb)
- creating channels
- #fetch
- destroying channels
- is Enumerable
(see spec/unit/realtime/client_spec.rb)
- behaves like a client initializer
- with invalid arguments
- empty hash
- nil
- key: "invalid"
- key: "invalid:asdad"
- key and key_name
- key and key_secret
- client_id as only option
- with valid arguments
- key only
- with a string key instead of options hash
- with a string token key instead of options hash
- with token
- with token_details
- with token_params
- endpoint
- defaults to production
- with environment option
- with rest_host option
- with realtime_host option
- with port option and non-TLS connections
- with tls_port option and a TLS connection
- tls
- defaults to TLS
- set to false
- logger
- default
- with log_level :none
- with custom logger and log_level
- delegators
- with invalid arguments
- delegation to the REST Client
- push
(see spec/unit/realtime/connection_spec.rb)
(see spec/unit/realtime/presence_spec.rb)
- callbacks
- subscriptions
- #subscribe
- without a block raises an invalid ArgumentError
- with no action specified subscribes the provided block to all action
- with a single action argument subscribes that block to matching actions
- with a multiple action arguments subscribes that block to all of those actions
- with a multiple duplicate action arguments subscribes that block to all of those unique actions once
- #unsubscribe
- with no action specified unsubscribes that block from all events
- with a single action argument unsubscribes the provided block with the matching action
- with multiple action arguments unsubscribes each of those matching actions with the provided block
- with a non-matching action argument has no effect
- with no block argument unsubscribes all blocks for the action argument
- #subscribe
(see spec/unit/realtime/push_channel_spec.rb)
- is constructed with a channel
- raises an exception if constructed with an invalid type
- exposes the channel as attribute #channel
- is available in the #push attribute of the channel
- methods not implemented as push notifications
(see spec/unit/realtime/realtime_spec.rb)
(see spec/unit/realtime/safe_deferrable_spec.rb)
- behaves like a safe Deferrable
- #errback
- #fail
- #callback
- #succeed
(see spec/unit/realtime/safe_deferrable_spec.rb)
- behaves like a safe Deferrable
- #errback
- #fail
- #callback
- #succeed
(see spec/unit/realtime/safe_deferrable_spec.rb)
- behaves like a safe Deferrable
- #errback
- #fail
- #callback
- #succeed
(see spec/unit/rest/channel_spec.rb)
- #initializer
- as UTF_8 string
- as frozen UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
- as Nil
- #publish name argument
- as UTF_8 string
- as frozen UTF_8 string
- as SHIFT_JIS string
- as ASCII_8BIT string
- as Integer
(see spec/unit/rest/channels_spec.rb)
- creating channels
- #fetch
- destroying channels
- is Enumerable
(see spec/unit/rest/client_spec.rb)
- behaves like a client initializer
- with invalid arguments
- empty hash
- nil
- key: "invalid"
- key: "invalid:asdad"
- key and key_name
- key and key_secret
- client_id as only option
- with valid arguments
- key only
- with a string key instead of options hash
- with a string token key instead of options hash
- with token
- with token_details
- with token_params
- endpoint
- defaults to production
- with environment option
- with rest_host option
- with realtime_host option
- with port option and non-TLS connections
- with tls_port option and a TLS connection
- tls
- defaults to TLS
- set to false
- logger
- default
- with log_level :none
- with custom logger and log_level
- delegators
- with invalid arguments
- initializer options
- TLS
- fallback_retry_timeout (#RSC15f)
- default
- when provided
- :use_token_auth
- set to false
- with a key and :tls => false
- without a key
- set to true
- without a key or token
- set to false
- request_id generation
- push
(see spec/unit/rest/push_channel_spec.rb)
- is constructed with a channel
- raises an exception if constructed with an invalid type
- exposes the channel as attribute #channel
- is available in the #push attribute of the channel
- methods not implemented as push notifications
(see spec/unit/rest/rest_spec.rb)
(see spec/unit/util/crypto_spec.rb)
- defaults
- get_default_params
- with just a :key param
- without a :key param
- with a base64-encoded :key param
- with provided params
- encrypts & decrypt
- encrypting an empty string
- using shared client lib fixture data
- with AES-128-CBC
- behaves like an Ably encrypter and decrypter (#RTL7d)
- with AES-256-CBC
- behaves like an Ably encrypter and decrypter (#RTL7d)
- with AES-128-CBC
(see spec/unit/util/pub_sub_spec.rb)
- event fan out
- #unsubscribe
- Passing tests: 2045
- Pending tests: 19
- Failing tests: 2