+ New Article
+
+ <%= turbo_frame_tag @article do %>
+ <%= form_with model: @article do |form| %>
+ <%= form.label :body %>
+ <%= form.text_area :body, aria: { describedby: (dom_id(@article, :errors) if @article.errors[:body].any?) } %>
+ <% if @article.errors[:body].any? %>
+
+ <%= @article.errors[:body].to_sentence %>
+
+ <% end %>
+
+ <%= form.button %>
+ <% end %>
+ <% end %>
+
diff --git a/test/streams/redirect_test.rb b/test/streams/redirect_test.rb
new file mode 100644
index 00000000..b3d5eca8
--- /dev/null
+++ b/test/streams/redirect_test.rb
@@ -0,0 +1,9 @@
+require "turbo_test"
+
+class Turbo::Streams::RedirectTest < ActionDispatch::IntegrationTest
+ test "html requests respond with a redirect HTTP status" do
+ post articles_path, params: { article: { body: "A valid value" } }
+
+ assert_redirected_to articles_url
+ end
+end
diff --git a/test/system/frames_test.rb b/test/system/frames_test.rb
new file mode 100644
index 00000000..ed723021
--- /dev/null
+++ b/test/system/frames_test.rb
@@ -0,0 +1,24 @@
+require "application_system_test_case"
+
+class FramesTest < ApplicationSystemTestCase
+ test "can render an invalid submission within a frame" do
+ visit new_article_path
+ toggle_disclosure "New Article"
+ click_on "Create Article"
+
+ within_disclosure "New Article" do
+ assert_field "Body", described_by: "can't be blank"
+ end
+ end
+
+ test "can redirect the entire page after a valid submission within a frame" do
+ visit new_article_path
+ toggle_disclosure "New Article"
+ fill_in "Body", with: "An article's body"
+ click_on "Create Article"
+
+ assert_no_selector :disclosure, "New Article"
+ assert_no_field "Body"
+ assert_text "An article's body"
+ end
+end
diff --git a/yarn.lock b/yarn.lock
index 777aff5d..146574d0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -23,10 +23,9 @@
chalk "^2.0.0"
js-tokens "^4.0.0"
-"@hotwired/turbo@^7.1.0":
- version "7.1.0"
- resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.1.0.tgz#27e44e0e3dc5bd1d4bda0766d579cf5a14091cd7"
- integrity sha512-Q8kGjqwPqER+CtpQudbH+3Zgs2X4zb6pBAlr6NsKTXadg45pAOvxI9i4QpuHbwSzR2+x87HUm+rot9F/Pe8rxA==
+"@hotwired/turbo@https://github.com/seanpdoyle/turbo.git#stream-renderer":
+ version "7.2.0-beta.1"
+ resolved "https://github.com/seanpdoyle/turbo.git#73b38ce91f833257d3da32145f27a059626d30fe"
"@rails/actioncable@^7.0":
version "7.0.1"