aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/configuration_test.rb46
-rw-r--r--railties/test/application/initializers/frameworks_test.rb1
-rw-r--r--railties/test/application/mailer_previews_test.rb52
-rw-r--r--railties/test/commands/console_test.rb22
-rw-r--r--railties/test/generators/app_generator_test.rb3
-rw-r--r--railties/test/generators/generators_test_helper.rb10
-rw-r--r--railties/test/generators/model_generator_test.rb2
-rw-r--r--railties/test/generators/plugin_generator_test.rb3
-rw-r--r--railties/test/isolation/abstract_unit.rb10
-rw-r--r--railties/test/railties/engine_test.rb4
10 files changed, 23 insertions, 130 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index ad15e30b6a..8f5b2d0d68 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -320,22 +320,6 @@ module ApplicationTests
end
end
- test "config.serve_static_assets is deprecated" do
- require "#{app_path}/config/application"
-
- assert_deprecated(/serve_static_assets/) do
- app.config.serve_static_assets = false
- end
-
- assert_not app.config.serve_static_files
- assert_deprecated(/serve_static_assets/) { assert_not app.config.serve_static_assets }
-
- app.config.serve_static_files = true
-
- assert app.config.serve_static_files
- assert_deprecated(/serve_static_assets/) { assert app.config.serve_static_assets }
- end
-
test "Use key_generator when secret_key_base is set" do
make_basic_app do |application|
application.secrets.secret_key_base = 'b3c631c314c0bbca50c1b2843150fe33'
@@ -1062,36 +1046,6 @@ module ApplicationTests
end
end
- test "Blank config.log_level is not deprecated for non-production environment" do
- with_rails_env "development" do
- assert_not_deprecated do
- make_basic_app do |application|
- application.config.log_level = nil
- end
- end
- end
- end
-
- test "Blank config.log_level is deprecated for the production environment" do
- with_rails_env "production" do
- assert_deprecated(/log_level/) do
- make_basic_app do |application|
- application.config.log_level = nil
- end
- end
- end
- end
-
- test "Not blank config.log_level is not deprecated for the production environment" do
- with_rails_env "production" do
- assert_not_deprecated do
- make_basic_app do |application|
- application.config.log_level = :info
- end
- end
- end
- end
-
test "config.log_level with custom logger" do
make_basic_app do |application|
application.config.logger = Logger.new(STDOUT)
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb
index 2d45c9b53f..97b51911d9 100644
--- a/railties/test/application/initializers/frameworks_test.rb
+++ b/railties/test/application/initializers/frameworks_test.rb
@@ -65,7 +65,6 @@ module ApplicationTests
RUBY
require "#{app_path}/config/environment"
- assert Foo.method_defined?(:foo_path)
assert Foo.method_defined?(:foo_url)
assert Foo.method_defined?(:main_app)
end
diff --git a/railties/test/application/mailer_previews_test.rb b/railties/test/application/mailer_previews_test.rb
index 9e4f858539..1752a9f3c6 100644
--- a/railties/test/application/mailer_previews_test.rb
+++ b/railties/test/application/mailer_previews_test.rb
@@ -428,58 +428,6 @@ module ApplicationTests
assert_match '<option selected value="?part=text%2Fplain">View as plain-text email</option>', last_response.body
end
- test "*_path helpers emit a deprecation" do
-
- app_file "config/routes.rb", <<-RUBY
- Rails.application.routes.draw do
- get 'foo', to: 'foo#index'
- end
- RUBY
-
- mailer 'notifier', <<-RUBY
- class Notifier < ActionMailer::Base
- default from: "from@example.com"
-
- def path_in_view
- mail to: "to@example.org"
- end
-
- def path_in_mailer
- @url = foo_path
- mail to: "to@example.org"
- end
- end
- RUBY
-
- html_template 'notifier/path_in_view', "<%= link_to 'foo', foo_path %>"
-
- mailer_preview 'notifier', <<-RUBY
- class NotifierPreview < ActionMailer::Preview
- def path_in_view
- Notifier.path_in_view
- end
-
- def path_in_mailer
- Notifier.path_in_mailer
- end
- end
- RUBY
-
- app('development')
-
- assert_deprecated do
- get "/rails/mailers/notifier/path_in_view.html"
- assert_equal 200, last_response.status
- end
-
- html_template 'notifier/path_in_mailer', "No ERB in here"
-
- assert_deprecated do
- get "/rails/mailers/notifier/path_in_mailer.html"
- assert_equal 200, last_response.status
- end
- end
-
private
def build_app
super
diff --git a/railties/test/commands/console_test.rb b/railties/test/commands/console_test.rb
index 4aea3e980f..de0cf0ba9e 100644
--- a/railties/test/commands/console_test.rb
+++ b/railties/test/commands/console_test.rb
@@ -46,28 +46,6 @@ class Rails::ConsoleTest < ActiveSupport::TestCase
assert_match(/Loading \w+ environment in sandbox \(Rails/, output)
end
- if RUBY_VERSION < '2.0.0'
- def test_debugger_option
- console = Rails::Console.new(app, parse_arguments(["--debugger"]))
- assert console.debugger?
- end
-
- def test_no_options_does_not_set_debugger_flag
- console = Rails::Console.new(app, parse_arguments([]))
- assert !console.debugger?
- end
-
- def test_start_with_debugger
- stubbed_console = Class.new(Rails::Console) do
- def require_debugger
- end
- end
-
- rails_console = stubbed_console.new(app, parse_arguments(["--debugger"]))
- silence_stream(STDOUT) { rails_console.start }
- end
- end
-
def test_console_with_environment
start ["-e production"]
assert_match(/\sproduction\s/, output)
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index e30c9a7b2f..40fd7b77f1 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -403,10 +403,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
if defined?(JRUBY_VERSION) || RUBY_ENGINE == "rbx"
assert_file "Gemfile" do |content|
assert_no_match(/byebug/, content)
- assert_no_match(/debugger/, content)
end
- elsif RUBY_VERSION < '2.0.0'
- assert_gem 'debugger'
else
assert_gem 'byebug'
end
diff --git a/railties/test/generators/generators_test_helper.rb b/railties/test/generators/generators_test_helper.rb
index 6cc91f166b..94099fcd2e 100644
--- a/railties/test/generators/generators_test_helper.rb
+++ b/railties/test/generators/generators_test_helper.rb
@@ -49,4 +49,14 @@ module GeneratorsTestHelper
end
end
end
+
+ def silence_stream(stream)
+ old_stream = stream.dup
+ stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
+ stream.sync = true
+ yield
+ ensure
+ stream.reopen(old_stream)
+ old_stream.close
+ end
end
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb
index afee0a655d..f3b699101f 100644
--- a/railties/test/generators/model_generator_test.rb
+++ b/railties/test/generators/model_generator_test.rb
@@ -223,7 +223,7 @@ class ModelGeneratorTest < Rails::Generators::TestCase
def test_migration_with_timestamps
run_generator
- assert_migration "db/migrate/create_accounts.rb", /t.timestamps null: false/
+ assert_migration "db/migrate/create_accounts.rb", /t.timestamps/
end
def test_migration_timestamps_are_skipped
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb
index e9f06a1fd7..318ea5b2cb 100644
--- a/railties/test/generators/plugin_generator_test.rb
+++ b/railties/test/generators/plugin_generator_test.rb
@@ -74,10 +74,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
if defined?(JRUBY_VERSION) || RUBY_ENGINE == "rbx"
assert_file "Gemfile" do |content|
assert_no_match(/byebug/, content)
- assert_no_match(/debugger/, content)
end
- elsif RUBY_VERSION < '2.0.0'
- assert_file "Gemfile", /# gem 'debugger'/
else
assert_file "Gemfile", /# gem 'byebug'/
end
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 9ad0ec0d34..39e8a5f756 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -338,6 +338,16 @@ class ActiveSupport::TestCase
end
end
end
+
+ def silence_stream(stream)
+ old_stream = stream.dup
+ stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
+ stream.sync = true
+ yield
+ ensure
+ stream.reopen(old_stream)
+ old_stream.close
+ end
end
# Create a scope and build a fixture rails app
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb
index 4ffcf64275..6185742cc1 100644
--- a/railties/test/railties/engine_test.rb
+++ b/railties/test/railties/engine_test.rb
@@ -741,8 +741,8 @@ YAML
assert_equal "bukkits_", Bukkits.table_name_prefix
assert_equal "bukkits", Bukkits::Engine.engine_name
assert_equal Bukkits.railtie_namespace, Bukkits::Engine
- assert ::Bukkits::MyMailer.method_defined?(:foo_path)
- assert !::Bukkits::MyMailer.method_defined?(:bar_path)
+ assert ::Bukkits::MyMailer.method_defined?(:foo_url)
+ assert !::Bukkits::MyMailer.method_defined?(:bar_url)
get("/bukkits/from_app")
assert_equal "false", last_response.body