diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-08-25 21:50:20 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-08-25 21:52:24 -0300 |
commit | af31cf067242757b2005197b10a2dfbe6bb89184 (patch) | |
tree | bb75cb70bc493ff91f19cf126acb089c384b1fa4 /actionpack/test | |
parent | 67153430861ca1305d77a73e631a9038049fbfa9 (diff) | |
download | rails-af31cf067242757b2005197b10a2dfbe6bb89184.tar.gz rails-af31cf067242757b2005197b10a2dfbe6bb89184.tar.bz2 rails-af31cf067242757b2005197b10a2dfbe6bb89184.zip |
Create variable only in the test that uses it
Instead of building a Blog::Post instance for every test in form helper
tests, just build it in the test that uses it.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 5c6cb45530..246c4bfada 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -81,8 +81,6 @@ class FormHelperTest < ActionView::TestCase @post.tags = [] @post.tags << Tag.new - @blog_post = Blog::Post.new("And his name will be forty and four.", 44) - @car = Car.new("#000FFF") end @@ -1168,7 +1166,9 @@ class FormHelperTest < ActionView::TestCase end def test_form_for_with_model_using_relative_model_naming - form_for(@blog_post) do |f| + blog_post = Blog::Post.new("And his name will be forty and four.", 44) + + form_for(blog_post) do |f| concat f.text_field :title concat f.submit('Edit post') end |