diff options
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/resource_generator_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb index aed45f190d..3d856f519b 100644 --- a/railties/test/generators/resource_generator_test.rb +++ b/railties/test/generators/resource_generator_test.rb @@ -78,6 +78,20 @@ class ResourceGeneratorTest < GeneratorsTestCase end end + def test_singleton_resource + run_generator ["account", "--singleton"] + + assert_file "app/controllers/account_controller.rb", /class AccountController < ApplicationController/ + assert_file "test/functional/account_controller_test.rb", /class AccountControllerTest < ActionController::TestCase/ + + assert_file "app/helpers/account_helper.rb", /module AccountHelper/ + assert_file "test/unit/helpers/account_helper_test.rb", /class AccountHelperTest < ActionView::TestCase/ + + assert_file "config/routes.rb" do |route| + assert_match /map\.resource :account$/, route + end + end + protected def run_generator(args=["account"]) |