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.