Moving all the functional tests to the Rails 2 way, which uses less code by having an additional sub-class to take care of the duplicate code in every test. There is a bug in rails 2.0.2, which means that super doesn't get called in the setup method in the functional tests. This is fixed in Rails 2.1.2, thus a version bump should really be done.

This commit is contained in:
Shaun McDonald 2008-10-28 12:27:10 +00:00
parent e18c33f733
commit 427becc1db
12 changed files with 13 additions and 111 deletions

View file

@ -1,22 +1,12 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'old_relation_controller'
# Re-raise errors caught by the controller.
#class OldRelationController; def rescue_action(e) raise e end; end
class OldRelationControllerTest < Test::Unit::TestCase
class OldRelationControllerTest < ActionController::TestCase
api_fixtures
def setup
@controller = OldRelationController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
# -------------------------------------
# Test reading old relations.
# -------------------------------------
def test_history
# check that a visible relations is returned properly
get :history, :id => relations(:visible_relation).id