Skip to content
Browse files

Improve test coverage and create fixtures for RenderPartialWithRecord…

…IdentificationTests
  • Loading branch information...
1 parent f90eb81 commit b603de08825eec05f1b97d0f5d71462f3fa4c222 @josh josh committed Jul 12, 2008
View
9 actionpack/test/activerecord/render_partial_with_record_identification_test.rb
@@ -56,26 +56,31 @@ def setup
def test_rendering_partial_with_has_many_and_belongs_to_association
get :render_with_has_many_and_belongs_to_association
assert_template 'projects/_project'
+ assert_equal 'Active RecordActive Controller', @response.body
end
def test_rendering_partial_with_has_many_association
get :render_with_has_many_association
assert_template 'replies/_reply'
+ assert_equal 'Birdman is better!', @response.body
end
def test_rendering_partial_with_named_scope
get :render_with_named_scope
assert_template 'replies/_reply'
+ assert_equal 'Birdman is better!Nuh uh!', @response.body
end
def test_render_with_record
get :render_with_record
assert_template 'developers/_developer'
+ assert_equal 'David', @response.body
end
def test_render_with_record_collection
get :render_with_record_collection
assert_template 'developers/_developer'
+ assert_equal 'DavidJamisfixture_3fixture_4fixture_5fixture_6fixture_7fixture_8fixture_9fixture_10Jamis', @response.body
end
def test_rendering_partial_with_has_one_association
@@ -165,11 +170,13 @@ def setup
def test_render_with_record_in_nested_controller
get :render_with_record_in_nested_controller
assert_template 'fun/games/_game'
+ assert_equal 'Pong', @response.body
end
def test_render_with_record_collection_in_nested_controller
get :render_with_record_collection_in_nested_controller
assert_template 'fun/games/_game'
+ assert_equal 'PongTank', @response.body
end
end
@@ -184,10 +191,12 @@ def setup
def test_render_with_record_in_deeper_nested_controller
get :render_with_record_in_deeper_nested_controller
assert_template 'fun/serious/games/_game'
+ assert_equal 'Chess', @response.body
end
def test_render_with_record_collection_in_deeper_nested_controller
get :render_with_record_collection_in_deeper_nested_controller
assert_template 'fun/serious/games/_game'
+ assert_equal 'ChessSudokuSolitaire', @response.body
end
end
View
1 actionpack/test/fixtures/developers/_developer.erb
@@ -0,0 +1 @@
+<%= developer.name %>
View
1 actionpack/test/fixtures/fun/games/_game.erb
@@ -0,0 +1 @@
+<%= game.name %>
View
1 actionpack/test/fixtures/fun/serious/games/_game.erb
@@ -0,0 +1 @@
+<%= game.name %>
View
1 actionpack/test/fixtures/projects/_project.erb
@@ -0,0 +1 @@
+<%= project.name %>
View
1 actionpack/test/fixtures/replies/_reply.erb
@@ -0,0 +1 @@
+<%= reply.content %>

0 comments on commit b603de0

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