mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix scaffold generator with --helper=false option
This commit is contained in:
parent
ac0a8eec62
commit
4ba0e2fc22
2 changed files with 15 additions and 0 deletions
|
@ -7,6 +7,7 @@ module Rails
|
|||
|
||||
check_class_collision suffix: "Controller"
|
||||
|
||||
class_option :helper, type: :boolean
|
||||
class_option :orm, banner: "NAME", type: :string, required: true,
|
||||
desc: "ORM to generate the controller for"
|
||||
|
||||
|
|
|
@ -256,6 +256,20 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_scaffold_generator_no_helper_with_switch_no_helper
|
||||
output = run_generator [ "posts", "--no-helper" ]
|
||||
|
||||
assert_no_match /error/, output
|
||||
assert_no_file "app/helpers/posts_helper.rb"
|
||||
end
|
||||
|
||||
def test_scaffold_generator_no_helper_with_switch_helper_false
|
||||
output = run_generator [ "posts", "--helper=false" ]
|
||||
|
||||
assert_no_match /error/, output
|
||||
assert_no_file "app/helpers/post_helper.rb"
|
||||
end
|
||||
|
||||
def test_scaffold_generator_no_stylesheets
|
||||
run_generator [ "posts", "--no-stylesheets" ]
|
||||
assert_no_file "app/assets/stylesheets/scaffold.css"
|
||||
|
|
Loading…
Reference in a new issue