# An elegant way of reusing Rails Test::Unit additions for Fit / Fitnesse fixtures

**URL:** <https://www.ruby-forum.com/t/an-elegant-way-of-reusing-rails-test-unit-additions-for-fit-fitnesse-fixtures/127123>\
**Category:** Rails\
**Created:** [January 25, 2008, 5:05am UTC](https://www.ruby-forum.com/t/an-elegant-way-of-reusing-rails-test-unit-additions-for-fit-fitnesse-fixtures/127123 "2008-01-25T05:05:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gishu\_Pillai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f6c823/32.png) [@Gishu\_Pillai](https://www.ruby-forum.com/u/Gishu_Pillai)\
**Post date:** [January 25, 2008, 5:05am UTC](https://www.ruby-forum.com/t/an-elegant-way-of-reusing-rails-test-unit-additions-for-fit-fitnesse-fixtures/127123/1 "2008-01-25T05:05:52Z")

</div>

Hi,

Rails testing support is awesome. I’ve been trying to use Fit -  
Fitnesse for acceptance testing.

Soon I was missing my get and post helper methods - Since they are  
part of Test::Unit and fit fixtures have to derive from fixture  
specific base classes. I turned to composition… created a dummy test  
case derivation as a member of the fixture. Distilled out the  
essential things… and it works.  
However i was curious as to the manner in which others accomplish the  
same thing. If you can think of better ways to do this… please post

require File.dirname( **FILE** ) + ‘/…/test/test\_helper’  
require ‘inflow\_controller’  
require ‘fit/fixture’

class RailsHelper \< Test::Unit::TestCase  
def setup  
@controller = InflowController.new  
@request = ActionController::TestRequest.new  
@response = ActionController::TestResponse.new  
end  
def test\_dummy  
end  
end  
module AcceptanceTests  
class EnterInflowRecords \< Fit::Fixture

```
attr_accessor :description, :amount
def initialize
  @helper = RailsHelper.new("test_dummy")
  @helper.setup
end
def addEntry
  @helper.get :new
  @helper.post :create, :credit => {:description =>

```

@description, :amount =\> @amount}  
end  
def current\_balance  
return 0  
end  
end  
end
