Skip to content

Commit

Permalink
Upgrade dummy app to Rails 7.1 and add a regression test for children…
Browse files Browse the repository at this point in the history
… rendering bug in 7.1
  • Loading branch information
patbenatar committed Oct 18, 2023
1 parent 179745f commit 5b37403
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 87 deletions.
217 changes: 133 additions & 84 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,80 +8,100 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.3)
actionpack (= 6.1.3)
activesupport (= 6.1.3)
actioncable (7.1.1)
actionpack (= 7.1.1)
activesupport (= 7.1.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.3)
actionpack (= 6.1.3)
activejob (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
zeitwerk (~> 2.6)
actionmailbox (7.1.1)
actionpack (= 7.1.1)
activejob (= 7.1.1)
activerecord (= 7.1.1)
activestorage (= 7.1.1)
activesupport (= 7.1.1)
mail (>= 2.7.1)
actionmailer (6.1.3)
actionpack (= 6.1.3)
actionview (= 6.1.3)
activejob (= 6.1.3)
activesupport (= 6.1.3)
net-imap
net-pop
net-smtp
actionmailer (7.1.1)
actionpack (= 7.1.1)
actionview (= 7.1.1)
activejob (= 7.1.1)
activesupport (= 7.1.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.3)
actionview (= 6.1.3)
activesupport (= 6.1.3)
rack (~> 2.0, >= 2.0.9)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2)
actionpack (7.1.1)
actionview (= 7.1.1)
activesupport (= 7.1.1)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.3)
actionpack (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.1)
actionpack (= 7.1.1)
activerecord (= 7.1.1)
activestorage (= 7.1.1)
activesupport (= 7.1.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.1.3)
activesupport (= 6.1.3)
actionview (7.1.1)
activesupport (= 7.1.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.3)
activesupport (= 6.1.3)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.1)
activesupport (= 7.1.1)
globalid (>= 0.3.6)
activemodel (6.1.3)
activesupport (= 6.1.3)
activerecord (6.1.3)
activemodel (= 6.1.3)
activesupport (= 6.1.3)
activestorage (6.1.3)
actionpack (= 6.1.3)
activejob (= 6.1.3)
activerecord (= 6.1.3)
activesupport (= 6.1.3)
marcel (~> 0.3.1)
mimemagic (~> 0.3.2)
activesupport (6.1.3)
activemodel (7.1.1)
activesupport (= 7.1.1)
activerecord (7.1.1)
activemodel (= 7.1.1)
activesupport (= 7.1.1)
timeout (>= 0.4.0)
activestorage (7.1.1)
actionpack (= 7.1.1)
activejob (= 7.1.1)
activerecord (= 7.1.1)
activesupport (= 7.1.1)
marcel (~> 1.0)
activesupport (7.1.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)
base64 (0.1.1)
bigdecimal (3.1.4)
builder (3.2.4)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.3)
diff-lcs (1.5.0)
drb (2.1.1)
ruby2_keywords
erubi (1.12.0)
ffi (1.15.0)
formatador (0.2.5)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalid (1.2.1)
activesupport (>= 6.1)
guard (2.16.2)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
Expand All @@ -98,27 +118,40 @@ GEM
rspec (>= 2.99.0, < 4.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.6.0)
irb (1.8.3)
rdoc
reline (>= 0.3.8)
listen (3.4.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.21.4)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.2.8)
mail (2.7.1)
mail (2.8.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
net-imap
net-pop
net-smtp
marcel (1.0.2)
memory_profiler (0.9.14)
method_source (1.0.0)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_mime (1.0.2)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitest (5.20.0)
mutex_m (0.1.2)
nenv (0.3.0)
nio4r (2.5.7)
net-imap (0.4.1)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.4.0)
net-protocol
nio4r (2.5.9)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
Expand All @@ -131,44 +164,56 @@ GEM
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
psych (5.1.1.1)
stringio
puma (5.6.2)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
rack (3.0.8)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.3)
actioncable (= 6.1.3)
actionmailbox (= 6.1.3)
actionmailer (= 6.1.3)
actionpack (= 6.1.3)
actiontext (= 6.1.3)
actionview (= 6.1.3)
activejob (= 6.1.3)
activemodel (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.1)
actioncable (= 7.1.1)
actionmailbox (= 7.1.1)
actionmailer (= 7.1.1)
actionpack (= 7.1.1)
actiontext (= 7.1.1)
actionview (= 7.1.1)
activejob (= 7.1.1)
activemodel (= 7.1.1)
activerecord (= 7.1.1)
activestorage (= 7.1.1)
activesupport (= 7.1.1)
bundler (>= 1.15.0)
railties (= 6.1.3)
sprockets-rails (>= 2.0.0)
railties (= 7.1.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (6.1.3)
actionpack (= 6.1.3)
activesupport (= 6.1.3)
method_source
rake (>= 0.8.7)
thor (~> 1.0)
railties (7.1.1)
actionpack (= 7.1.1)
activesupport (= 7.1.1)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rake (13.0.6)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.5.0)
psych (>= 4.0.0)
reline (0.3.9)
io-console (~> 0.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -193,19 +238,23 @@ GEM
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.1)
ruby2_keywords (0.0.5)
shellany (0.0.1)
sprockets (4.0.2)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
stringio (3.0.8)
thor (1.3.0)
timeout (0.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
websocket-driver (0.7.3)
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.12)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ To list all methods being called, enable `RBEXY_TEMPLATE_PATH_DEBUG` and
run tests:
```
docker-compose run -e RBEXY_TEMPLATE_PATH_DEBUG=1 rbexy appraisal bin/test
docker-compose run -e RBEXY_TEMPLATE_PATH_DEBUG=1 rbexy bundle exec appraisal bin/test
```
## Contributing
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class WithChildren::EmptyChildrenComponent < Rbexy::Component
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<WithChildren.Parent>
<h1>Text in a child</h1>
</WithChildren.Parent>

<WithChildren.Parent>
</WithChildren.Parent>
6 changes: 4 additions & 2 deletions spec/dummy/app/components/with_children/parent_component.rbx
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<h1>Here come the children...</h1>
{content}
<div class="parent">
<h1>Here come the children...</h1>
{content}
</div>
5 changes: 5 additions & 0 deletions spec/integration/component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
expect(result).to have_tag("h1", text: "Text in a child")
end

it "renders empty parent components when they have no children" do
result = WithChildren::EmptyChildrenComponent.new(view_context).render_in
expect(result.gsub(/\s{2,}/, "")).to eq '<div class="parent"><h1>Here come the children...</h1><h1>Text in a child</h1></div><div class="parent"><h1>Here come the children...</h1></div>'
end

it "allows the component to implement #call instead of a template" do
class MyCallComponent < Rbexy::Component
def call
Expand Down

0 comments on commit 5b37403

Please sign in to comment.