diff options
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index cbcfe48f71..bd8efcc6c7 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -156,6 +156,32 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + def test_add_gemfile_entry + template = Tempfile.open 'my_template' + template.puts 'gemfile_entry "tenderlove"' + template.flush + + run_generator([destination_root, "-m", template.path]) + assert_file "Gemfile", /tenderlove/ + ensure + template.close + template.unlink + end + + def test_add_skip_entry + template = Tempfile.open 'my_template' + template.puts 'add_gem_entry_filter { |gem| gem.name != "jbuilder" }' + template.flush + + run_generator([destination_root, "-m", template.path]) + assert_file "Gemfile" do |contents| + assert_no_match 'jbuilder', contents + end + ensure + template.close + template.unlink + end + def test_config_another_database run_generator([destination_root, "-d", "mysql"]) assert_file "config/database.yml", /mysql/ |