render_turbo_stream 0.1.44 → 0.1.46

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: ea0b39e1e5da88d8de2c8d84f287f6ce8ca6012b6ca203266fdf0f647f05a50f
4
- data.tar.gz: a488032ebb3f9975e8ca9ec90b5e86238780f85a385efca0e4a01ece52f3440c
3
+ metadata.gz: 3efa13a85fa7384096fdd81f4bceb089e73111d07b074ddc579f98e27af2511e
4
+ data.tar.gz: 69f47bbda0dfc94d5af491dcce47cd2eb5df464d8e404058483adcd26b480cb9
5
5
  SHA512:
6
- metadata.gz: f137735dcfc2b7d77147e6cee12e432377f165b57fc7d42fd33274cd7865f99a8c8d58b66340ee3de695ceb3393c6a88584a70347143de211fab80200962a14d
7
- data.tar.gz: 44813c9288b2c1d4d206e848969ddcc3a486ef1e3034a13bb66b581a582044dc42dfff8e2c12df573efbf45b9a55ab52d2b5a6e5651837a1b73957b22e89e94f
6
+ metadata.gz: b20d62b2f1fc7617050300d5960bbec912562b86a498b41652f1956e52459aa3ab63ecde9386ecbe7849eb66f8c6ddb3d139f4a03c79cf8761f8e06c672b0f80
7
+ data.tar.gz: 2a8e3d7b5bc35b28e73e00da9c5c526a76bea089129c5c4fa8e8d93e50cb9359417b77c944935636d570c2f783ff7566236c9e7dad74e7ae0422b236ee51cfb1
data/README.md CHANGED
@@ -122,17 +122,23 @@ RSpec.describe "Articles", type: :request do
122
122
  expect(partials_log.join('')).to include('Article could not be created')
123
123
  expect(partials_log.join('')).to include('layouts/flash')
124
124
 
125
- expect(partials_count).to eq(2)
126
- #=> 2 partials in total: form, flash, no matter how many times each is rendered (example «flash»: a flash partial can be rendered several times)
125
+ # THERE ARE 3 COUNTS
127
126
 
128
- expect(partial_response('form')).to eq(true)
129
- expect(partial_response('layouts/flash')).to eq(true)
130
- expect(partial_response('flash', id: 'flash-wrapper', count: 1)).to eq(true)
131
- #=> id is the ID that turbo-stream pointed to (for replace/append/... an item)
127
+ # A) Number of partials: "form" and "flash" are 2 partials
128
+
129
+ expect(partials_count).to eq(2)
132
130
 
133
- expect(partial_response('flash'){|r|r.inner_html.include?('Article could not be created')}).to eq(true)
134
- expect(partial_response('flash'){|r|r.css('div').inner_html.include?('Article could not be created')}).to eq(true)
135
- #=> if a partial was rendered more than once: at least one response must match
131
+ # B) Total count of responses per partial (1 => is default)
132
+
133
+ expect(partial_response_count('articles/form', total: 1, id: 'form')).to be_truthy
134
+ # id is the html id to which turbo-stream is pointing.
135
+
136
+ # C) If a block is given: the number of matching responses returned by "partial_response_count".
137
+
138
+ expect(partial_response_count('flash'){|r|r.inner_html.include?('Article could not be created')}).to eq(1)
139
+ # result is either nil (if 0 matched) or a integer >= 1
140
+
141
+ expect(partial_response_count('flash'){|r|r.css('div').inner_html.include?('Article could not be created')}).to eq(1)
136
142
  #=> you can use the validators of nokogiri, check: https://nokogiri.org/tutorials/parsing_an_html_xml_document.html
137
143
  end
138
144
 
@@ -1,3 +1,3 @@
1
1
  module RenderTurboStream
2
- VERSION = "0.1.44"
2
+ VERSION = "0.1.46"
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.44
4
+ version: 0.1.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian
@@ -71,6 +71,5 @@ requirements: []
71
71
  rubygems_version: 3.4.12
72
72
  signing_key:
73
73
  specification_version: 4
74
- summary: Render turbo-stream partials directly from the controller, including test
75
- helpers
74
+ summary: Render turbo-stream partials directly from the controller. Test helpers included
76
75
  test_files: []