Skip to content

Commit 1caa6ce

Browse files
committed
test: add coverage for generator templates
and matrix across Rails 7.2, 8.0, and main
1 parent 4fe7139 commit 1caa6ce

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/upstream.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
plat: ["ubuntu", "windows", "macos"]
46+
ref: ["7-2-stable", "v8.0.0.beta1", "main"]
4647
env:
47-
RAILSOPTS: --git=https://github.com/rails/rails --branch main
48+
RAILSOPTS: --git=https://github.com/rails/rails --ref=${{ ref }}
4849
steps:
4950
- uses: actions/checkout@v4
5051
- uses: ruby/setup-ruby@v1

test/integration/user_journey_test.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ bundle show --paths
3737
bin/rails tailwindcss:install
3838

3939
# TEST: tailwind was installed correctly
40-
grep tailwind app/views/layouts/application.html.erb
40+
grep -q tailwind app/views/layouts/application.html.erb
4141

4242
# TEST: rake tasks don't exec (#188)
4343
cat <<EOF >> Rakefile
@@ -47,3 +47,13 @@ end
4747
EOF
4848

4949
bin/rails tailwindcss:build still_here | grep "Rake process did not exit early"
50+
51+
if [[ $(rails -v) > "Rails 8.0.0.beta" ]] ; then
52+
# TEST: presence of the generated file
53+
bin/rails generate authentication
54+
grep -q PasswordsController app/controllers/passwords_controller.rb
55+
fi
56+
57+
# TEST: presence of the generated file
58+
bin/rails generate scaffold post title:string body:text published:boolean
59+
grep -q "Show this post" app/views/posts/index.html.erb

0 commit comments

Comments
 (0)