render_turbo_stream 0.1.26 → 0.1.28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d128b7674b363238eb61eb3801963559ceced131f779d2461eab167f1900a55
4
- data.tar.gz: b2ca434807990e05b1adfed8919917bf41a22c7f1578444c5164a23b9c174ad9
3
+ metadata.gz: 4ddfe2fddf5d0990264594bd1bac97f8ad8846d344e63446a1b7d5ac263c0c9d
4
+ data.tar.gz: 0e56a273cc7cd654e5be6957565c982be9b8ad1fa2a0fa1155f97c5e6815cae9
5
5
  SHA512:
6
- metadata.gz: bacc8838158e95146849e34b7df62d71f5006737e94d036e7389394f10e13cbb7d8b1eecd4ca387d453917e64d902cef1ead32566a12ff75543ac5d07dbbafc1
7
- data.tar.gz: fea7aec70e2707113e8ffc77d2e12bbd17ea63baa9f62e3dd3fd34487abeabf1d2b96e08806c814b307663c61621a5dfb533dce56385f51d5381839f507bb837
6
+ metadata.gz: d7b25b72283be57909d4085752c0457b2db91de7174df9e8e83f3daf1da784eaca70b509fa1fa5ed28c6cf9f8896916679265914c28db8a0fb00117479d0c858
7
+ data.tar.gz: 7d8ed294add44a776cd5e5fdfefd51380ef7af5063543fa49cac33155df50a9448966cc1c5599731d665aa0fc9ac1d2bea9fbdfc7a35af44b612c3c18680bed9
data/README.md CHANGED
@@ -6,6 +6,8 @@ Working consistently with turbo_stream means shooting lots of partials from the
6
6
 
7
7
  It sets the status, generates a flash message, handles redirection, pushes it all to the front and comes with predefined helpers for enabling request-specs.
8
8
 
9
+ An overview of how we design a rails-7 application with turbo is [published on dev.to](https://dev.to/chmich/rails-7-vite-wrapping-up-1pia).
10
+
9
11
  ## Installation
10
12
 
11
13
  ```ruby
@@ -52,7 +54,7 @@ The corresponding partials for flashes could look [like this](https://gitlab.com
52
54
  end
53
55
  ```
54
56
 
55
- This will set a status, generate a flash message and perform `stream_partials', which could result in something like this:
57
+ This will set a status, generate a flash message and perform `stream_partials`, which could result in something like this:
56
58
 
57
59
  ```ruby
58
60
  stream_partials(
@@ -70,7 +72,7 @@ stream_partials(
70
72
  )
71
73
  ```
72
74
 
73
- The `stream_partial' method is nothing more than a singular of `stream_partials'.
75
+ The `stream_partial` method is nothing else than a singular of `stream_partials`.
74
76
 
75
77
  ```ruby
76
78
  stream_partial(
@@ -100,13 +102,13 @@ RSpec.describe "Articles", type: :request do
100
102
  it 'create failed' do
101
103
  post articles_path(params: invalid_params)
102
104
 
103
- # to which ids turbo-stream responded
105
+ # to which html-ids turbo-stream would point
104
106
  expect(partials_ids).to include('flash-box', 'form')
105
107
 
106
108
  # which partials where rendered
107
109
  expect(partials_paths).to include('layouts/flash', 'articles/form')
108
110
 
109
- # 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
111
+ # partial_response (singular) returns false unless partial responded exactly one time, otherwise the content parsed by nokogiri, see how to handle: https://nokogiri.org/tutorials/searching_a_xml_html_document.html#basic-searching
110
112
  r = partial_response(id: 'flash-box')
111
113
  expect(r.css('div.text-content').first.inner_html).to include('Article could not be created')
112
114
 
@@ -129,7 +131,7 @@ The test for a redirection might look something like this:
129
131
  it 'update success' do
130
132
  a = FactoryBot.create(:article)
131
133
  patch article_path(a, params: valid_params)
132
- expect(turbo_redirected_to).to eq(articles_path)
134
+ expect(turbo_redirect_to).to eq(articles_path)
133
135
  end
134
136
  ```
135
137
 
@@ -51,7 +51,7 @@ module RenderTurboStream
51
51
  end
52
52
 
53
53
  # Returns the path to which turbo_stream.redirect_to would be applied.
54
- def turbo_redirected_to
54
+ def turbo_redirect_to
55
55
  expect(response.status).to eq(302)
56
56
  r = JSON.parse(response.body)
57
57
  r['redirected_to']
@@ -1,3 +1,3 @@
1
1
  module RenderTurboStream
2
- VERSION = "0.1.26"
2
+ VERSION = "0.1.28"
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.26
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian