(see lib/submodules/ably-ruby/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
- using MsgPack protocol
- fetching the service time
- should return the service time as a Time object
- with reconfigured HTTP timeout
- fetching the service time
(see lib/submodules/ably-ruby/spec/acceptance/rest/client_spec.rb)
- using JSON protocol
- #initialize
- with only an 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
- 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
- FAILED:
is absent when requests do not fail - with the first request failing
- with all requests failing
- FAILED:
- #initialize
- using MsgPack protocol
- #initialize
- with only an 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
- 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
- FAILED:
is absent when requests do not fail - with the first request failing
- with all requests failing
- FAILED:
- #initialize
(see lib/submodules/ably-ruby/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
- using MsgPack 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 lib/submodules/ably-ruby/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
- using MsgPack 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 lib/submodules/ably-ruby/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
- using MsgPack 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 lib/submodules/ably-ruby/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
- 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
- using MsgPack 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
- 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 lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/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
- using MsgPack 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 lib/submodules/ably-ruby/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
- FAILED:
logs a deprecation warning (#RSA10l) - FAILED:
returns a valid token (#RSA10l)
- FAILED:
- using MsgPack 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
- FAILED:
logs a deprecation warning (#RSA10l) - FAILED:
returns a valid token (#RSA10l)
- FAILED:
(see lib/submodules/ably-ruby/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
- using MsgPack 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 lib/submodules/ably-ruby/spec/unit/logger_spec.rb)
- uses the language provided Logger by default
- with a custom Logger
- with an invalid interface
- with a valid interface
- FAILED:
is used
- FAILED:
- with blocks
- does not call the block unless the log level is met
- with an exception in the logger block
(see lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/spec/unit/models/auth_details_spec.rb)
- behaves like a model
- attributes
- #access_token
- #==
- is immutable
- attributes
- ==
(see lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/spec/unit/models/error_info_spec.rb)
- behaves like a model
- attributes
- #code
- #status_code
- #message
- #==
- is immutable
- attributes
- #status
(see lib/submodules/ably-ruby/spec/unit/models/message_spec.rb)
- behaves like a model
- attributes
- #id
- #name
- #client_id
- #data
- #encoding
- #==
- is immutable
- attributes
- #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 lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/spec/unit/models/connection_state_change_spec.rb)
- #current (#TA2)
- #previous(#TA2)
- #event(#TA5)
- #retry_in (#TA2)
- #reason (#TA3)
- invalid attributes
(see lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/spec/unit/models/channel_state_change_spec.rb)
- #current (#TH1)
- #previous (#TH2)
- #event (#TH5)
- #reason (#TH3)
- #resumed (#TH4)
- invalid attributes
(see lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/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
- FAILED:
uses the custom logger - FAILED:
sets the custom log level
- FAILED:
- delegators
- with invalid arguments
- initializer options
- TLS
- :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
(see lib/submodules/ably-ruby/spec/unit/rest/channels_spec.rb)
- creating channels
- #fetch
- destroying channels
- is Enumerable
(see lib/submodules/ably-ruby/spec/unit/rest/rest_spec.rb)
(see lib/submodules/ably-ruby/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 lib/submodules/ably-ruby/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
- Passing tests: 1186
- Pending tests: 1
- Failing tests: 0