Skip to content

Commit

Permalink
use stub instead of redefining method to suppress warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lest committed Jan 6, 2012
1 parent 056b838 commit f1b05de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/test/template/form_helper_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ def test_form_for_with_remote_in_html


def test_form_for_with_remote_without_html def test_form_for_with_remote_without_html
@post.persisted = false @post.persisted = false
def @post.to_key; nil; end @post.stubs(:to_key).returns(nil)
form_for(@post, :remote => true) do |f| form_for(@post, :remote => true) do |f|
concat f.text_field(:title) concat f.text_field(:title)
concat f.text_area(:body) concat f.text_area(:body)
Expand Down Expand Up @@ -1025,7 +1025,7 @@ def test_submit_with_object_as_new_record_and_locale_strings
old_locale, I18n.locale = I18n.locale, :submit old_locale, I18n.locale = I18n.locale, :submit


@post.persisted = false @post.persisted = false
def @post.to_key; nil; end @post.stubs(:to_key).returns(nil)
form_for(@post) do |f| form_for(@post) do |f|
concat f.submit concat f.submit
end end
Expand Down

0 comments on commit f1b05de

Please sign in to comment.