mirror of https://github.com/rails/rails
Merge pull request #51068 from Edouard-chin/ec-dont-load-test-from-fixture
Don't load `*_test.rb` file from the "fixtures" folder:
This commit is contained in:
commit
2e4a2b7eea
|
@ -1,3 +1,7 @@
|
||||||
|
* `bin/rails test` will no longer load files named `*_test.rb` if they are located in the `fixtures` folder.
|
||||||
|
|
||||||
|
*Edouard Chin*
|
||||||
|
|
||||||
* Ensure logger tags configured with `config.log_tags` are still active in `request.action_dispatch` handlers
|
* Ensure logger tags configured with `config.log_tags` are still active in `request.action_dispatch` handlers
|
||||||
|
|
||||||
*KJ Tsanaktsidis*
|
*KJ Tsanaktsidis*
|
||||||
|
|
|
@ -87,7 +87,7 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_test_exclude_glob
|
def default_test_exclude_glob
|
||||||
ENV["DEFAULT_TEST_EXCLUDE"] || "test/{system,dummy}/**/*_test.rb"
|
ENV["DEFAULT_TEST_EXCLUDE"] || "test/{system,dummy,fixtures}/**/*_test.rb"
|
||||||
end
|
end
|
||||||
|
|
||||||
def regexp_filter?(arg)
|
def regexp_filter?(arg)
|
||||||
|
|
|
@ -1223,6 +1223,12 @@ module ApplicationTests
|
||||||
assert_match "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips", output
|
assert_match "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips", output
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_run_does_not_load_file_from_the_fixture_folder
|
||||||
|
create_test_file "fixtures", "smoke_foo"
|
||||||
|
|
||||||
|
assert_match "0 runs, 0 assertions, 0 failures, 0 errors, 0 skips", run_test_command("")
|
||||||
|
end
|
||||||
|
|
||||||
def test_can_exclude_files_from_being_tested_via_default_rails_command_by_setting_DEFAULT_TEST_EXCLUDE_env_var
|
def test_can_exclude_files_from_being_tested_via_default_rails_command_by_setting_DEFAULT_TEST_EXCLUDE_env_var
|
||||||
create_test_file "smoke", "smoke_foo"
|
create_test_file "smoke", "smoke_foo"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue