Skip to content

Commit ef1f77e

Browse files
nimmoloclaude
andcommitted
Remove added block-handling specs per maintainer request
Reverting spec additions to match main branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 59b4997 commit ef1f77e

2 files changed

Lines changed: 2 additions & 64 deletions

File tree

spec/superform/rails/components/input_component_spec.rb

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RSpec.describe Superform::Rails::Components::Input, type: :view do
1+
RSpec.describe Superform::Rails::Components::Input do
22
let(:field) do
33
object = double("object", "foo=": nil)
44
object = double("object", "foo": value)
@@ -65,19 +65,4 @@
6565
end
6666
it { is_expected.to have_client_provided_value }
6767
end
68-
69-
describe "block handling" do
70-
it "does not accept blocks in view_template" do
71-
# Input is a void element and should not render block content
72-
html = render(component)
73-
expect(html).to eq('<input id="foo" name="foo" type="text" value="a string">')
74-
end
75-
76-
it "ignores block content if accidentally passed" do
77-
# Even if someone tries to pass a block, it should be ignored
78-
html = render(component) { "This should not appear" }
79-
expect(html).to eq('<input id="foo" name="foo" type="text" value="a string">')
80-
expect(html).not_to include("This should not appear")
81-
end
82-
end
8368
end

spec/superform/rails/field_convenience_methods_spec.rb

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require "spec_helper"
44

5-
RSpec.describe Superform::Rails::Form::Field, type: :view do
5+
RSpec.describe Superform::Rails::Form::Field do
66
let(:user) { User.new(email: "test@example.com", first_name: "John") }
77
let(:form) { Superform::Rails::Form.new(user) }
88
let(:field) { form.field(:email) }
@@ -60,51 +60,4 @@
6060
expect(component.type).to eq("radio")
6161
end
6262
end
63-
64-
describe "block handling" do
65-
# Input elements are void elements and should not accept blocks.
66-
# These tests verify that blocks are properly ignored.
67-
68-
it "does not render block content for text input" do
69-
html = render(field.text { "Block content" })
70-
expect(html).not_to include("Block content")
71-
expect(html).to match(/<input[^>]*type="text"[^>]*>/)
72-
end
73-
74-
it "does not render block content for email input" do
75-
html = render(field.email { "Block content" })
76-
expect(html).not_to include("Block content")
77-
expect(html).to match(/<input[^>]*type="email"[^>]*>/)
78-
end
79-
80-
it "does not render block content for password input" do
81-
html = render(field.password { "Block content" })
82-
expect(html).not_to include("Block content")
83-
expect(html).to match(/<input[^>]*type="password"[^>]*>/)
84-
end
85-
86-
it "does not render block content for hidden input" do
87-
html = render(field.hidden { "Block content" })
88-
expect(html).not_to include("Block content")
89-
expect(html).to match(/<input[^>]*type="hidden"[^>]*>/)
90-
end
91-
92-
it "does not render block content for number input" do
93-
html = render(field.number { "Block content" })
94-
expect(html).not_to include("Block content")
95-
expect(html).to match(/<input[^>]*type="number"[^>]*>/)
96-
end
97-
98-
it "does not render block content for date input" do
99-
html = render(field.date { "Block content" })
100-
expect(html).not_to include("Block content")
101-
expect(html).to match(/<input[^>]*type="date"[^>]*>/)
102-
end
103-
104-
it "does not render block content for file input" do
105-
html = render(field.file { "Block content" })
106-
expect(html).not_to include("Block content")
107-
expect(html).to match(/<input[^>]*type="file"[^>]*>/)
108-
end
109-
end
11063
end

0 commit comments

Comments
 (0)