From ff4c6004484a3201f28f7512531c4e8f5f58b617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 28 Jun 2009 19:57:00 +0200 Subject: Added singleton support to resource controller. --- railties/test/generators/resource_generator_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'railties/test/generators/resource_generator_test.rb') 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"]) -- cgit v1.2.3