From 4c5046ffa16ea77da4e4b69517dcb33bc6ec2646 Mon Sep 17 00:00:00 2001 From: John Dong Date: Tue, 21 Aug 2007 15:12:02 -0400 Subject: [PATCH] Revise functional test of graph controller for retrieving an unknown id number. Currently I think raising RecordNotFound is fine. The alternate would be to generate a record not found PNG, but I don't see the point of doing that either. --- test/functional/graph_controller_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/graph_controller_test.rb b/test/functional/graph_controller_test.rb index e147707..e5c2790 100644 --- a/test/functional/graph_controller_test.rb +++ b/test/functional/graph_controller_test.rb @@ -19,15 +19,15 @@ class GraphControllerTest < Test::Unit::TestCase # TODO Replace this with your actual tests def test_show_nonexist_votes_per_interval - assert_nothing_raised { get :votes_per_interval, { :id => 42 } } + assert_raise(ActiveRecord::RecordNotFound) { get :votes_per_interval, { :id => 42 } } end def test_show_nonexist_borda_bar - assert_nothing_raised { get :borda_bar, { :id => 42 } } + assert_raise(ActiveRecord::RecordNotFound) { get :borda_bar, { :id => 42 } } end def test_show_nonexist_choices_positions - assert_nothing_raised { get :choices_positions, { :id => 42 } } + assert_raise(ActiveRecord::RecordNotFound) { get :choices_positions, { :id => 42 } } end def test_show_empty_votes_per_interval -- 2.30.2