render_turbo_stream 0.1.37 → 0.1.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/lib/render_turbo_stream/request_test_helpers.rb +8 -7
- 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: 8ab1bc2e64e1c8b702db49bb7d0e23b6624d6e017f8f619c2dbfacba0c532598
|
4
|
+
data.tar.gz: 33431e1a09d659c6b531c21970e03d556671c27b06af3ba93d477130fc5997b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b36a34b7c9eb520d03abab8eeb27c55f9f18538940278acf9d6db5e79747a71897499ed85d3fa4162cf542b1de638eb7d816dd52fa300245aee5d812bb7baaf
|
7
|
+
data.tar.gz: e1ea9eab5c37f8aab1e8336119df9dae2fa0bc7761cf18a918e242d00c02a1e14645875aaeef91e096242e16cd53e7eba698161b02a5fdc91e684b706423f12d
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ from [turbo_power](https://github.com/marcoroth/turbo_power).
|
|
44
44
|
Required Configurations for Flash Partial
|
45
45
|
|
46
46
|
```ruby
|
47
|
-
|
47
|
+
config.x.render_turbo_stream.flash_partial = 'layouts/flash'
|
48
48
|
config.x.render_turbo_stream.flash_id = 'flash-box'
|
49
49
|
config.x.render_turbo_stream.flash_action = 'prepend'
|
50
50
|
```
|
@@ -147,10 +147,9 @@ RSpec.describe "Articles", type: :request do
|
|
147
147
|
expect(partials_responses(id: 'flash-box').length).to eq(1)
|
148
148
|
|
149
149
|
# Same with partials
|
150
|
-
|
151
150
|
expect(partials_responses(partial: 'layouts/flash').length).to eq(1)
|
152
151
|
|
153
|
-
#
|
152
|
+
# partials_log: developer info for what the renderer has done and strings for copy and paste into test commands
|
154
153
|
expect(partials_log.join('')).to include('Article could not be created')
|
155
154
|
expect(partials_log.join('')).to include('layouts/flash')
|
156
155
|
|
@@ -89,17 +89,18 @@ module RenderTurboStream
|
|
89
89
|
# log as helper for the developer to see which flash is set and which partials are rendered to wich ids
|
90
90
|
def partials_log
|
91
91
|
r = []
|
92
|
-
if flash[:alert].present?
|
93
|
-
r.push("flash[:alert]: «#{flash[:alert]}»")
|
94
|
-
end
|
95
|
-
if flash[:notice].present?
|
96
|
-
r.push("flash[:notice]: «#{flash[:notice]}»")
|
97
|
-
end
|
98
92
|
if response.status == 302
|
99
93
|
r.push("redirect to #{turbo_redirect_to}")
|
100
94
|
else
|
101
95
|
partials_attributes.map do |a|
|
102
|
-
str = [
|
96
|
+
str = [
|
97
|
+
a['action'],
|
98
|
+
'id',
|
99
|
+
"«#{a['id']}»",
|
100
|
+
'by partial',
|
101
|
+
"«#{a['partial']}»",
|
102
|
+
(a['locals'].present? ? "locals: «#{a['locals']}»" : nil)
|
103
|
+
].compact.join(' ')
|
103
104
|
r.push(str)
|
104
105
|
end
|
105
106
|
end
|