<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
I''m having problems with functional
test, fixtures and legacy
tables, the situation:<br>
<br>
I have a model like this: <br>
<font color="#009900">
# encoding:
UTF-8</font><br>
<font color="#3333ff">
class Product
<
ActiveRecord::Base</font><br>
self.table_name_prefix =
"xst_"
<br>
<font color="#3333ff">
end</font><br>
<br>
And the fixture (just renamed the file from
"prodcut.yml" to
"xst_product.yml" the scaffold).<br>
<font color="#009900"># encoding:
UTF-8</font><br>
<font color="#3333ff">
one:<br>
title: MyString</font><br>
<br>
And the functional test (no
changes)<br>
<font color="#009900"># encoding:
UTF-8</font><br>
<font color="#3333ff">
require
''test_helper''</font><br>
<br>
<font color="#3333ff">class
ProductsControllerTest <
ActionController::TestCase</font><br>
setup <font
color="#3333ff">do</font><br>
@product =
products(:one)<br>
<font
color="#3333ff">end</font><br>
<br>
test "should get index"
<font color="#3333ff">do</font><br>
get
:index<br>
assert_response
:success<br>
assert_not_nil
assigns(:products)<br>
<font
color="#3333ff">end</font><br>
...<br>
<font
color="#3333ff">end</font><br>
<br>
The unit test works fine, but when I run the
functional test I
just receive "<font color="#cc0000">NoMethodError:
undefined method</font>"
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?.<br>
<br>
I will appreciate any help.<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Miquel Cubel Escarré
+34 699 73 22 46
<a class="moz-txt-link-abbreviated"
href="mailto:mcubel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">mcubel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>
"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.</pre>
</body>
</html>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.<br />
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org<br />
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org<br
/>
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.<br />