aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG.md2
-rw-r--r--railties/test/generators/named_base_test.rb23
2 files changed, 14 insertions, 11 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 43eee9f442..fb3953f866 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -77,7 +77,7 @@
*Andrew White*
-* Don't remove all line endings from routes.rb when revoking scaffold.
+* Don't remove all line endings from `config/routes.rb` when revoking scaffold.
Fixes #15913.
diff --git a/railties/test/generators/named_base_test.rb b/railties/test/generators/named_base_test.rb
index 18a26fde05..1c32fc1bfd 100644
--- a/railties/test/generators/named_base_test.rb
+++ b/railties/test/generators/named_base_test.rb
@@ -1,6 +1,6 @@
require 'generators/generators_test_helper'
require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator'
-require 'mocha/setup' # FIXME: stop using mocha
+require 'minitest/mock'
class NamedBaseTest < Rails::Generators::TestCase
include GeneratorsTestHelper
@@ -80,10 +80,13 @@ class NamedBaseTest < Rails::Generators::TestCase
def test_application_name
g = generator ['Admin::Foo']
- Rails.stubs(:application).returns(Object.new)
- assert_name g, "object", :application_name
- Rails.stubs(:application).returns(nil)
- assert_name g, "application", :application_name
+ Rails.stub(:application, Object.new) do
+ assert_name g, "object", :application_name
+ end
+
+ Rails.stub(:application, nil) do
+ assert_name g, "application", :application_name
+ end
end
def test_index_helper
@@ -103,11 +106,11 @@ class NamedBaseTest < Rails::Generators::TestCase
def test_hide_namespace
g = generator ['Hidden']
- g.class.stubs(:namespace).returns('hidden')
-
- assert !Rails::Generators.hidden_namespaces.include?('hidden')
- g.class.hide!
- assert Rails::Generators.hidden_namespaces.include?('hidden')
+ g.class.stub(:namespace, 'hidden') do
+ assert !Rails::Generators.hidden_namespaces.include?('hidden')
+ g.class.hide!
+ assert Rails::Generators.hidden_namespaces.include?('hidden')
+ end
end
def test_scaffold_plural_names_with_model_name_option