mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove use of mocha in the named base tests
This commit is contained in:
parent
a66a64aa2a
commit
3ca5ae57b5
1 changed files with 13 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue