From d4e008fd0f9ebac3383a0c3ac093de68db9e2e66 Mon Sep 17 00:00:00 2001 From: Kyle Maxwell Date: Thu, 11 Feb 2010 16:04:24 -0800 Subject: Invalid namespace on app generation raises an error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/test/generators/app_generator_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'railties/test/generators') diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 0a746b200f..01d643cd8c 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -50,6 +50,11 @@ class AppGeneratorTest < Rails::Generators::TestCase ).each{ |path| assert_file path } end + def test_name_collision_raises_an_error + content = capture(:stderr){ run_generator [File.join(destination_root, "generate")] } + assert_equal "Invalid application name generate. Please give a name which does not match one of the reserved rails words.\n", content + end + def test_invalid_database_option_raises_an_error content = capture(:stderr){ run_generator([destination_root, "-d", "unknown"]) } assert_match /Invalid value for \-\-database option/, content -- cgit v1.2.3 From d0454e57661ceeaebd6f3fce4a608ec624257b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 17 Feb 2010 18:09:13 +0100 Subject: Add readme as method in Rails::Generators::Actions (as we had in 2.3) --- railties/test/generators/actions_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'railties/test/generators') diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index 5929db6318..3585e6e7c0 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -210,6 +210,12 @@ class ActionsTest < Rails::Generators::TestCase assert_file 'config/routes.rb', /#{Regexp.escape(route_command)}/ end + def test_readme + run_generator + Rails::Generators::AppGenerator.expects(:source_root).returns(destination_root) + assert_match(/Welcome to Rails/, action(:readme, "README")) + end + protected def action(*args, &block) -- cgit v1.2.3 From 79c47abe6ce0bdcc81c35aa30da8a05c3650d04d Mon Sep 17 00:00:00 2001 From: Ramon Soares Date: Sun, 21 Feb 2010 20:49:54 -0300 Subject: the folder public/javascripts should be created by default [#4027 status:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/test/generators/app_generator_test.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'railties/test/generators') diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 01d643cd8c..412034029e 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -107,6 +107,7 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_prototype_and_test_unit_are_skipped_if_required run_generator [destination_root, "--skip-prototype", "--skip-testunit"] assert_no_file "public/javascripts/prototype.js" + assert_file "public/javascripts" assert_no_file "test" end -- cgit v1.2.3