aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/record_tag_helper_test.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-17 23:04:18 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-18 00:44:26 -0200
commit22ffc3dceaa83bcbfcfa541cc992346e6d428fbf (patch)
treea13a6344a119dbc60d786348ccd4e6feafde38a3 /actionpack/test/template/record_tag_helper_test.rb
parent53381be007785369f5f3c41a19693a2ec0d43e31 (diff)
downloadrails-22ffc3dceaa83bcbfcfa541cc992346e6d428fbf.tar.gz
rails-22ffc3dceaa83bcbfcfa541cc992346e6d428fbf.tar.bz2
rails-22ffc3dceaa83bcbfcfa541cc992346e6d428fbf.zip
Cleanup persisted setup for model
Diffstat (limited to 'actionpack/test/template/record_tag_helper_test.rb')
-rw-r--r--actionpack/test/template/record_tag_helper_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/template/record_tag_helper_test.rb b/actionpack/test/template/record_tag_helper_test.rb
index 97dfb473d2..127e1b6bdd 100644
--- a/actionpack/test/template/record_tag_helper_test.rb
+++ b/actionpack/test/template/record_tag_helper_test.rb
@@ -11,6 +11,7 @@ class Post
@body = nil
super
+ @persisted = true
yield self if block_given?
end
@@ -31,7 +32,6 @@ class RecordTagHelperTest < ActionView::TestCase
def setup
super
@post = Post.new
- @post.persisted = true
end
def test_content_tag_for
@@ -79,16 +79,16 @@ class RecordTagHelperTest < ActionView::TestCase
end
def test_content_tag_for_collection
- post_1 = Post.new { |post| post.id = 101; post.body = "Hello!"; post.persisted = true }
- post_2 = Post.new { |post| post.id = 102; post.body = "World!"; post.persisted = true }
+ post_1 = Post.new { |post| post.id = 101; post.body = "Hello!" }
+ post_2 = Post.new { |post| post.id = 102; post.body = "World!" }
expected = %(<li class="post" id="post_101">Hello!</li>\n<li class="post" id="post_102">World!</li>)
actual = content_tag_for(:li, [post_1, post_2]) { |post| post.body }
assert_dom_equal expected, actual
end
def test_div_for_collection
- post_1 = Post.new { |post| post.id = 101; post.body = "Hello!"; post.persisted = true }
- post_2 = Post.new { |post| post.id = 102; post.body = "World!"; post.persisted = true }
+ post_1 = Post.new { |post| post.id = 101; post.body = "Hello!" }
+ post_2 = Post.new { |post| post.id = 102; post.body = "World!" }
expected = %(<div class="post" id="post_101">Hello!</div>\n<div class="post" id="post_102">World!</div>)
actual = div_for([post_1, post_2]) { |post| post.body }
assert_dom_equal expected, actual
@@ -100,8 +100,8 @@ class RecordTagHelperTest < ActionView::TestCase
end
def test_content_tag_for_collection_is_html_safe
- post_1 = Post.new { |post| post.id = 101; post.body = "Hello!"; post.persisted = true }
- post_2 = Post.new { |post| post.id = 102; post.body = "World!"; post.persisted = true }
+ post_1 = Post.new { |post| post.id = 101; post.body = "Hello!" }
+ post_2 = Post.new { |post| post.id = 102; post.body = "World!" }
result = content_tag_for(:li, [post_1, post_2]) { |post| post.body }
assert result.html_safe?
end