Class: Inertia::RSpec::TestResponse
- Inherits:
-
Object
- Object
- Inertia::RSpec::TestResponse
- Defined in:
- lib/inertia/rspec.rb
Overview
Wraps an Inertia response for test assertions.
Instance Method Summary collapse
-
#component ⇒ String
Returns the component name.
-
#deferred_props ⇒ Hash
Returns the deferred props configuration.
-
#initialize(data) ⇒ TestResponse
constructor
A new instance of TestResponse.
-
#props ⇒ Hash{Symbol => Object}
Returns the props with symbolized keys.
Constructor Details
#initialize(data) ⇒ TestResponse
Returns a new instance of TestResponse.
14 15 16 |
# File 'lib/inertia/rspec.rb', line 14 def initialize(data) @data = data end |
Instance Method Details
#component ⇒ String
Returns the component name.
28 29 30 |
# File 'lib/inertia/rspec.rb', line 28 def component @data[:component] end |
#deferred_props ⇒ Hash
Returns the deferred props configuration.
35 36 37 |
# File 'lib/inertia/rspec.rb', line 35 def deferred_props @data[:deferredProps] || {} end |
#props ⇒ Hash{Symbol => Object}
Returns the props with symbolized keys.
21 22 23 |
# File 'lib/inertia/rspec.rb', line 21 def props sybmolize_keys(@data[:props]) end |