Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
fail-fast: false
matrix:
plat: ["ubuntu"]
ref: ["7-2-stable", "8-0-stable", "main"]
ref: ["7-2-stable", "8-0-stable", "8-1-stable", "main"]
env:
RAILSOPTS: --git=https://github.com/rails/rails --ref=${{ matrix.ref }}
steps:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `tailwindcss-rails` Changelog

## next / unreleased

### Improved

* Support Rails 8.1 scaffolding which disables system tests by default. #585 @flavorjones


## v4.3.0 / 2025-07-06

### Improved
Expand Down
7 changes: 3 additions & 4 deletions lib/generators/test_unit/scaffold/scaffold_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ module TestUnit # :nodoc:
module Generators # :nodoc:
class ScaffoldGenerator < Base # :nodoc:
def fix_system_test
if turbo_defined? && options[:system_tests]
gsub_file File.join("test/system", class_path, "#{file_name.pluralize}_test.rb"),
/(click_on.*Destroy this.*)$/,
"accept_confirm { \\1 }"
system_test_file = File.join("test/system", class_path, "#{file_name.pluralize}_test.rb")
if turbo_defined? && options[:system_tests] && File.exist?(system_test_file)
gsub_file(system_test_file, /(click_on.*Destroy this.*)$/, "accept_confirm { \\1 }")
end
end

Expand Down
6 changes: 5 additions & 1 deletion test/integration/user_install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ if [[ $(rails -v) > "Rails 8.0.0.beta" ]] ; then
grep -q PasswordsController app/controllers/passwords_controller.rb
fi

# TEST: doesn't fail when not generating system tests
bin/rails generate scaffold memo title:string body:text published:boolean --system-tests=false
grep -q "Show" app/views/memos/index.html.erb

# TEST: presence of the generated file
bin/rails generate scaffold post title:string body:text published:boolean
bin/rails generate scaffold post title:string body:text published:boolean --system-tests=true
grep -q "Show" app/views/posts/index.html.erb

# TEST: the "accept_confirm" system test change was applied cleanly
Expand Down