mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use stub instead of redefining method to suppress warnings
This commit is contained in:
parent
056b8386d0
commit
f1b05deba7
1 changed files with 2 additions and 2 deletions
|
@ -875,7 +875,7 @@ class FormHelperTest < ActionView::TestCase
|
|||
|
||||
def test_form_for_with_remote_without_html
|
||||
@post.persisted = false
|
||||
def @post.to_key; nil; end
|
||||
@post.stubs(:to_key).returns(nil)
|
||||
form_for(@post, :remote => true) do |f|
|
||||
concat f.text_field(:title)
|
||||
concat f.text_area(:body)
|
||||
|
@ -1025,7 +1025,7 @@ class FormHelperTest < ActionView::TestCase
|
|||
old_locale, I18n.locale = I18n.locale, :submit
|
||||
|
||||
@post.persisted = false
|
||||
def @post.to_key; nil; end
|
||||
@post.stubs(:to_key).returns(nil)
|
||||
form_for(@post) do |f|
|
||||
concat f.submit
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue