mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix order dependent AP test
any_instance.stubs + unstub with Mocha doesn't restore the original status in the following case, so we need to undef Customer#to_json before every test require 'test/unit' require 'mocha/setup' module M def foo() :foo; end end class C include M undef_method :foo end C.any_instance.stubs(:foo).returns(:mocha) C.any_instance.unstub(:foo)
This commit is contained in:
parent
d7fc97d3f9
commit
24869e38af
1 changed files with 1 additions and 0 deletions
|
@ -646,6 +646,7 @@ class RespondWithControllerTest < ActionController::TestCase
|
|||
Mime::Type.register_alias('text/html', :iphone)
|
||||
Mime::Type.register_alias('text/html', :touch)
|
||||
Mime::Type.register('text/x-mobile', :mobile)
|
||||
Customer.send(:undef_method, :to_json) if Customer.method_defined?(:to_json)
|
||||
end
|
||||
|
||||
def teardown
|
||||
|
|
Loading…
Reference in a new issue