File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
lib/rails/generators/rails/plugin Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -489,9 +489,11 @@ def relative_path
489
489
490
490
def test_command
491
491
if engine? && !options [ :skip_active_record ] && with_dummy_app?
492
- "db:test:prepare test"
492
+ "bin/rails db:test:prepare test"
493
+ elsif engine?
494
+ "bin/rails test"
493
495
else
494
- "test"
496
+ "bin/ test"
495
497
end
496
498
end
497
499
end
Original file line number Diff line number Diff line change 90
90
DATABASE_URL: postgres://postgres:postgres@localhost:5432
91
91
<%- end -%>
92
92
# REDIS_URL: redis://localhost:6379/0
93
- run: bin/rails <%= test_command %>
93
+ run: <%= test_command %>
94
94
95
95
- name: Keep screenshots from failed system tests
96
96
uses: actions/upload-artifact@v4
Original file line number Diff line number Diff line change @@ -915,6 +915,21 @@ def test_app_update_generates_bin_file
915
915
Object . send ( :remove_const , "ENGINE_ROOT" )
916
916
end
917
917
918
+ def test_railtie_test_command
919
+ run_generator [ destination_root ]
920
+ assert_file ".github/workflows/ci.yml" , /run: bin\/ test/
921
+ end
922
+
923
+ def test_engine_test_command
924
+ run_generator [ destination_root , "--full" ]
925
+ assert_file ".github/workflows/ci.yml" , /run: bin\/ rails db:test:prepare test/
926
+ end
927
+
928
+ def test_engine_without_active_record_test_command
929
+ run_generator [ destination_root , "--full" , "--skip-active-record" ]
930
+ assert_file ".github/workflows/ci.yml" , /run: bin\/ rails test/
931
+ end
932
+
918
933
private
919
934
def action ( *args , &block )
920
935
silence ( :stdout ) { generator . send ( *args , &block ) }
You can’t perform that action at this time.
0 commit comments