aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb5
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/Gemfile3
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/rails/application.rb6
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/test/integration/navigation_test.rb.tt7
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/test/support/integration_case.rb5
-rw-r--r--railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb14
6 files changed, 5 insertions, 35 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
index 2fdd67944e..67b9c968d7 100644
--- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
+++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -215,8 +215,9 @@ end
def application_definition
@application_definition ||= begin
- unless options[:pretend]
- contents = File.read(File.expand_path("#{dummy_path}/config/application.rb", destination_root))
+ dummy_application_path = File.expand_path("#{dummy_path}/config/application.rb", destination_root)
+ unless options[:pretend] || !File.exists?(dummy_application_path)
+ contents = File.read(dummy_application_path)
contents[(contents.index("module Dummy"))..-1]
end
end
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/Gemfile b/railties/lib/rails/generators/rails/plugin_new/templates/Gemfile
index 899a9366d3..53a925d976 100644
--- a/railties/lib/rails/generators/rails/plugin_new/templates/Gemfile
+++ b/railties/lib/rails/generators/rails/plugin_new/templates/Gemfile
@@ -2,9 +2,6 @@ source "http://rubygems.org"
<%= rails_gemfile_entry -%>
-gem "capybara", ">= 0.3.9"
-gem "sqlite3-ruby", :require => "sqlite3"
-
if RUBY_VERSION < '1.9'
gem "ruby-debug", ">= 0.10.3"
end
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/rails/application.rb b/railties/lib/rails/generators/rails/plugin_new/templates/rails/application.rb
index fee63ea83e..ce655ba7e5 100644
--- a/railties/lib/rails/generators/rails/plugin_new/templates/rails/application.rb
+++ b/railties/lib/rails/generators/rails/plugin_new/templates/rails/application.rb
@@ -1,10 +1,6 @@
require File.expand_path('../boot', __FILE__)
-require "active_model/railtie"
-require "active_record/railtie"
-require "action_controller/railtie"
-require "action_view/railtie"
-require "action_mailer/railtie"
+require 'rails/all'
Bundler.require
require "<%= name %>"
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/test/integration/navigation_test.rb.tt b/railties/lib/rails/generators/rails/plugin_new/templates/test/integration/navigation_test.rb.tt
deleted file mode 100644
index 42721899c8..0000000000
--- a/railties/lib/rails/generators/rails/plugin_new/templates/test/integration/navigation_test.rb.tt
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class NagivationTest < ActiveSupport::IntegrationCase
- test "truth" do
- assert_kind_of Dummy::Application, Rails.application
- end
-end
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/test/support/integration_case.rb b/railties/lib/rails/generators/rails/plugin_new/templates/test/support/integration_case.rb
deleted file mode 100644
index 4cfe3f0e71..0000000000
--- a/railties/lib/rails/generators/rails/plugin_new/templates/test/support/integration_case.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# Define a bare test case to use with Capybara
-class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
- include Capybara
- include Rails.application.routes.url_helpers
-end \ No newline at end of file
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
index 5c39780a23..791b901593 100644
--- a/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
@@ -4,19 +4,7 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
-ActionMailer::Base.delivery_method = :test
-ActionMailer::Base.perform_deliveries = true
-ActionMailer::Base.default_url_options[:host] = "test.com"
-
Rails.backtrace_cleaner.remove_silencers!
-# Configure capybara for integration testing
-require "capybara/rails"
-Capybara.default_driver = :rack_test
-Capybara.default_selector = :css
-
-# Run any available migration
-ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
-
# Load support files
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } \ No newline at end of file
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }