Problems with functional test and legacy tables

<meta http-equiv="content-type" content="text/html; 

charset=ISO-8859-1">

Hi,

    I'm having problems with functional test, fixtures and legacy tables, the situation:

    I have a model like this:
            # encoding: UTF-8
            class Product < ActiveRecord::Base
                self.table_name_prefix = "xst_"      
            end
   
    And the fixture (just renamed the file from "prodcut.yml" to "xst_product.yml" the scaffold).
            # encoding: UTF-8
            one:
              title: MyString

    And the functional test (no changes)
            # encoding: UTF-8
            require 'test_helper'

            class ProductsControllerTest < ActionController::TestCase
              setup do
                @product = products(:one)
              end

              test "should get index" do
                get :index
                assert_response :success
                assert_not_nil assigns(:products)
              end
            ...
            end

    The unit test works fine, but when I run the functional test I just receive "NoMethodError: undefined method" for all the test, after many "test" I have arrived to the conclusion that the problem comes from the functional test that can-not find the fixtures. Is there any way to specify the prefix or a table name in the fixture?.

    I will appreciate any help.

   
--
Miquel C. Escarré
+34 699 73 22 46
[email protected]

“Computers are good at following instructions, but not at reading your
mind.” Donald Knuth.

“Los ordenadores son buenos siguiendo instrucciones, pero no leyendo tu
mente.” Donald Knuth.

–

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.

To post to this group, send email to
[email protected].

To unsubscribe from this group, send email to
[email protected].

For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.