Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add tests for helpers and node passing in object ref

  • Loading branch information...
commit 97f64af5ba7c8c5407b80bf834d2f665de6cf513 1 parent b0c23ea
@databyte databyte authored
View
8 fixtures/ashared/views_rails_3/posts/show.rabl
@@ -14,4 +14,10 @@ end
code(:created_date) do |p|
partial("posts/date", :object => p.created_at)
-end
+end
+
+node(:foo) { helper_foo }
+
+node(:post) do |post|
+ [post.title, post.body]
+end
View
3  fixtures/rails3_2/app/helpers/application_helper.rb
@@ -1,2 +1,5 @@
module ApplicationHelper
+ def helper_foo
+ "BAR!"
+ end
end
View
4 test/integration/rails3_2/posts_controller_test.rb
@@ -132,6 +132,10 @@
asserts("contains date partial with hour") { topic['hour'] }.equals { @post1.created_at.hour }
asserts("contains date partial with full") { topic['full'] }.equals { @post1.created_at.iso8601 }
end # date node
+
+ asserts("contains helper action") { topic["foo"] }.equals { "BAR!" }
+
+ asserts("contains post attributes via node") { topic["post"] }.equals { [@post1.title, @post1.body] }
end # show action, json
context "for index action rendering JSON within HTML" do
Please sign in to comment.
Something went wrong with that request. Please try again.