Fix scaffold generator with --helper=false option

This commit is contained in:
Rafael Mendonça França 2015-01-01 23:16:30 -03:00
parent ac0a8eec62
commit 4ba0e2fc22
2 changed files with 15 additions and 0 deletions

View File

@ -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"

View File

@ -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"