Skip to content
Browse files

we don't need extra iVar for hash backed author

  • Loading branch information...
1 parent cb64b80 commit 7710c3b0e9c21261fbeb31ce1b91ff00e4335256 @nashby nashby committed Sep 11, 2012
Showing with 2 additions and 6 deletions.
  1. +1 −3 test/action_view_extensions/builder_test.rb
  2. +1 −3 test/action_view_extensions/form_helper_test.rb
View
4 test/action_view_extensions/builder_test.rb
@@ -545,10 +545,8 @@ def with_collection_check_boxes(object, attribute, collection, value_method, tex
end
test 'fields for with a hash like model yeilds an instance of FormBuilder' do
- @hash_backed_author = HashBackedAuthor.new
-
with_concat_form_for(:user) do |f|
- f.simple_fields_for(:author, @hash_backed_author) do |author|
+ f.simple_fields_for(:author, HashBackedAuthor.new) do |author|
assert author.instance_of?(SimpleForm::FormBuilder)
author.input :name
end
View
4 test/action_view_extensions/form_helper_test.rb
@@ -92,9 +92,7 @@ class FormHelperTest < ActionView::TestCase
end
test 'fields for with a hash like model yeilds an instance of FormBuilder' do
- @hash_backed_author = HashBackedAuthor.new
-
- with_concat_fields_for(:author, @hash_backed_author) do |f|
+ with_concat_fields_for(:author, HashBackedAuthor.new) do |f|
assert f.instance_of?(SimpleForm::FormBuilder)
f.input :name
end

0 comments on commit 7710c3b

Please sign in to comment.
Something went wrong with that request. Please try again.