render_turbo_stream 0.1.30 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fceaabe20c5a6533f02917d1cc9512a7941980780ad94e5968b2fe594f9c300e
4
- data.tar.gz: 9d12b4e354a672f93e31544e6153b57b16e4ae9fd8c2fae8b316fc2c19c956d2
3
+ metadata.gz: 45e043a4b3096676a058b2558d29cfdd9e1580757f973464d727ef63e5cb54f8
4
+ data.tar.gz: d905cc69bd7b28c3bbd32ed807acd9386862446292acc90c5506e6d3e6a36bcf
5
5
  SHA512:
6
- metadata.gz: f96b57506c02e8c106f2fac7c920750bd951b635d787c2170408d6aea397e1f3184926878d2306e701aade88a50630a0df7839358e8aa81509e7db43cca66285
7
- data.tar.gz: 9ddb505c068cbee6863abc72f2094448f8b68dc6df01201ef87a3dc3e645ca0898fb773da7bdb738facf60d985eeff5fc47eb49cacc696fc63f2e7d9c021ba89
6
+ metadata.gz: 8ff9c676ed207c0b59eb1f3949b69c73f482100c2d775ebba417acebba2fbfe0ff25e0d10906b752101b391e9d47f5c2147e60feef0c87b7a291b81fdf86a1f5
7
+ data.tar.gz: 145930ea3e14e690b8c27cce58338daf236f562b7fbb9119532656669180c6d63f3fad5a4f386e34a1c19cc0e9b1419a621d45c9d5f5e8816f7d1b8865e662b7
data/README.md CHANGED
@@ -100,13 +100,20 @@ RSpec.describe "Articles", type: :request do
100
100
  let(:invalid_params) { { article: { title: '', desciption: 'abc' } } }
101
101
 
102
102
  it 'create failed' do
103
+
103
104
  post articles_path(params: invalid_params)
104
105
 
106
+ # Which partials were rendered
107
+ expect(partials_count).to eq(2)
108
+ expect(partials).to include('layouts/flash', 'articles/form')
109
+
110
+
111
+
112
+
113
+ # ----- MORE OPTIONS -----
114
+
105
115
  # to which html-ids turbo-stream would point
106
116
  expect(partials_ids).to include('flash-box', 'form')
107
-
108
- # which partials were rendered
109
- expect(partials_paths).to include('layouts/flash', 'articles/form')
110
117
 
111
118
  # partial_response (singular) returns false unless partial responded exactly one time, otherwise the content in nokogiri format: https://nokogiri.org/tutorials/searching_a_xml_html_document.html#basic-searching
112
119
  r = partial_response(id: 'flash-box')
@@ -125,7 +132,7 @@ RSpec.describe "Articles", type: :request do
125
132
  expect(partials_responses(id: 'flash-box').length).to eq(1)
126
133
 
127
134
  # Same with partials
128
- expect(partials_count).to eq(2)
135
+
129
136
  expect(partials_responses(partial: 'layouts/flash').length).to eq(1)
130
137
  end
131
138
  end
@@ -34,7 +34,7 @@ module RenderTurboStream
34
34
  end
35
35
 
36
36
  def partials_count
37
- partials_paths.length
37
+ partials.length
38
38
  end
39
39
 
40
40
  # array of strings of ids of rendered partials that turbo_stream pointed to
@@ -46,7 +46,7 @@ module RenderTurboStream
46
46
  end
47
47
 
48
48
  # array of strings of paths by which partials are rendered, for example: ['articles/form'].
49
- def partials_paths
49
+ def partials
50
50
  ary = partials_attributes
51
51
  paths = []
52
52
  ary.each {|a| paths.push(a['partial']) unless paths.include?(a['partial']) }
@@ -1,3 +1,3 @@
1
1
  module RenderTurboStream
2
- VERSION = "0.1.30"
2
+ VERSION = "0.1.31"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: render_turbo_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian