mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't generate system test files if skip_system_test
option is specified
This commit is contained in:
parent
f785ad786a
commit
a6d907e588
2 changed files with 15 additions and 0 deletions
|
@ -34,6 +34,10 @@ module <%= app_const_base %>
|
||||||
# Middleware like session, flash, cookies can be added back manually.
|
# Middleware like session, flash, cookies can be added back manually.
|
||||||
# Skip views, helpers and assets when generating a new resource.
|
# Skip views, helpers and assets when generating a new resource.
|
||||||
config.api_only = true
|
config.api_only = true
|
||||||
|
<%- elsif !depends_on_system_test? -%>
|
||||||
|
|
||||||
|
# Don't generate system test files.
|
||||||
|
config.generators.system_tests = nil
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -452,6 +452,17 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_does_not_generate_system_test_files_if_skip_system_test_is_given
|
||||||
|
run_generator [destination_root, "--skip_system_test"]
|
||||||
|
|
||||||
|
Dir.chdir(destination_root) do
|
||||||
|
quietly { `./bin/rails g scaffold User` }
|
||||||
|
|
||||||
|
assert_no_file("test/application_system_test_case.rb")
|
||||||
|
assert_no_file("test/system/users_test.rb")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_generator_if_api_is_given
|
def test_generator_if_api_is_given
|
||||||
run_generator [destination_root, "--api"]
|
run_generator [destination_root, "--api"]
|
||||||
assert_file "Gemfile" do |content|
|
assert_file "Gemfile" do |content|
|
||||||
|
|
Loading…
Reference in a new issue