Permalink
Browse files

Do not stub id here

  • Loading branch information...
1 parent 26a9bfb commit 3853b73bf8535efcf55f573f4b269e1082c3d5cd @spastorino spastorino committed Jan 6, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 actionpack/test/template/form_helper_test.rb
@@ -65,7 +65,7 @@ def count() 1 end
def full_messages() [ "Author name can't be empty" ] end
}.new
end
- def @post.id; 123; end
+ def @post.to_key; [123]; end
def @post.id_before_type_cast; 123; end
def @post.to_param; '123'; end
@@ -628,7 +628,7 @@ def test_index_with_nil_id
end
def test_auto_index
- pid = @post.id
+ pid = 123
assert_dom_equal(
"<label for=\"post_#{pid}_title\">Title</label>",
label("post[]", "title")
@@ -654,7 +654,7 @@ def test_auto_index
end
def test_auto_index_with_nil_id
- pid = @post.id
+ pid = 123
assert_dom_equal(
"<input name=\"post[#{pid}][title]\" size=\"30\" type=\"text\" value=\"Hello World\" />",
text_field("post[]","title", :id => nil)
@@ -867,7 +867,7 @@ def test_form_for_with_remote_in_html
def test_form_for_with_remote_without_html
@post.persisted = false
- def @post.id; nil; end
+ def @post.to_key; nil; end
form_for(@post, :remote => true) do |f|
concat f.text_field(:title)
concat f.text_area(:body)
@@ -1017,7 +1017,7 @@ def test_submit_with_object_as_new_record_and_locale_strings
old_locale, I18n.locale = I18n.locale, :submit
@post.persisted = false
- def @post.id; nil; end
+ def @post.to_key; nil; end
form_for(@post) do |f|
concat f.submit
end
@@ -2089,7 +2089,7 @@ def test_form_for_with_existing_object
def test_form_for_with_new_object
post = Post.new
post.persisted = false
- def post.id() nil end
+ def post.to_key; nil; end
form_for(post) do |f| end

0 comments on commit 3853b73

Please sign in to comment.