render_turbo_stream 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/lib/render_turbo_stream/test_helpers.rb +1 -1
- data/lib/render_turbo_stream/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f77bf1ea988efddf104ee8327848fcfbcab2ae409a0956cebffe960959dedef
|
4
|
+
data.tar.gz: 7f3b3395c1573cd0f5169e940497032d0be567cd068af5772242bb985943b8ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f7d73436e44a44b0b9fa03c2d2571df60cf056d84d8cd34269e04f8297a6bf21daf5728574961b369e5f919906128ced08795dad7cc5664bb327718c69b0fc1
|
7
|
+
data.tar.gz: 97f95322bc0fc0963a276f20b92cb1fc345efab29ab6884cf0f6c12fe8fdf8e49ad2c188bc1d6365227dba820f55577f44f649c26176a0037dab252f5a37ab60
|
data/README.md
CHANGED
@@ -22,6 +22,10 @@ ApplicationController
|
|
22
22
|
include RenderTurboStream
|
23
23
|
```
|
24
24
|
|
25
|
+
Redirection
|
26
|
+
|
27
|
+
For redirection to work, you must follow the installation steps from [turbo_power](https://github.com/marcoroth/turbo_power).
|
28
|
+
|
25
29
|
Required Configurations for Flash Partial
|
26
30
|
|
27
31
|
```ruby
|
@@ -92,10 +96,13 @@ include RenderTurboStream::TestHelpers
|
|
92
96
|
RSpec.describe "Articles", type: :request do
|
93
97
|
|
94
98
|
let(:invalid_params) { { article: { title: '', desciption: 'abc' } } }
|
95
|
-
|
99
|
+
|
96
100
|
it 'create failed' do
|
97
101
|
post articles_path(params: invalid_params)
|
98
102
|
|
103
|
+
# singular (partial_*) returns false if this element is cero or multiple times rendered to, otherwise the content
|
104
|
+
expect(partial_html_by_id('flash-box')).to include('Article could not be created')
|
105
|
+
|
99
106
|
expect(response.status).to eq(422)
|
100
107
|
expect(partials_count).to eq(2)
|
101
108
|
|
@@ -111,9 +118,6 @@ RSpec.describe "Articles", type: :request do
|
|
111
118
|
expect(partials_html_by_id['flash-box'].length).to eq(1)
|
112
119
|
expect(partials_html_by_id['flash-box'].first).to include('Article could not be created')
|
113
120
|
|
114
|
-
# unique_partial returns false if this ID is cero or multiple times rendered to
|
115
|
-
expect(partial_html_by_id_unique('flash-box')).to include('Article could not be created')
|
116
|
-
|
117
121
|
# *_path is the controller_path for calling the partial
|
118
122
|
expect(partials_params_by_path['layouts/flash'].length).to eq(1)
|
119
123
|
expect(partials_params_by_path['layouts/flash'].first['partial']).to eq('layouts/flash')
|