Displaying 20 results from an estimated 5000 matches similar to: "Fixture accessors broken for polymorphism, in need of redesign"
2010 Dec 12
5
Fixtures and unit tests - no such file to load
Hello all,
I''m having some issues with my test fixtures and unit tests and am
hoping somebody has an idea about how to fix it.
Background:
I have a table in my legacy database called tp_approval_step.
For this table I have a fixture called tp_approval_step.yml
I have a model called ApprovalProcessStep that uses set_table_name
''tp_approval_step''
In my test file,
2006 Mar 06
4
Change to set_fixture_class
So, I sat down to use set_fixture_class, and it bombed on the first
thing I tried:
set_fixture_class :content_drafts => "Article::Draft"
I made a quick patch, and I''d appreciate a quick run through your
tests to make sure it doesn''t disturb anything:
http://dev.rubyonrails.org/ticket/4095
As I was typing this, I realized that the string gives us no benefits.
I
2006 May 23
2
Putting fixtures into subdirectories
I want to organize my fixtures just like the namespace of my models. So
for example if I have a model Company::Employee I''d like the fixture to
be in fixtures/company/employees.yml.
However, I can''t figure out how to specify the path of the fixture file.
If I do:
fixtures :employees
in my unit test it can''t find the fixture file. Any suggestions?
Thanks,
Todd
2011 Aug 17
7
autoloading LoadError: Expected known_ip.rb to define KnownIp
Hello, i have a problem with autoloading model classes.
I have had similar problems before when a file''s name in Rails'' opinion
did not match with the name of the class defined inside, but eventually
everything worked, so i didn''t look into details.
This time the problem comes from running Unit Tests and does not want to
go away.
I have a model class KnownIP defined in
2008 Jun 19
0
Error loading fixtures with classes that set_table_name
Hi all,
I just hit a big wall involving a legacy database. I''ve got an active
record class called "School" that uses "set_table_name ''old_school''" to
map to a legacy database table:
class School < ActiveRecord::Base
set_table_name ''old_school''
end
It works great, until I''m testing and I want to use fixtures.
2008 Jun 23
0
Error loading fixtures for classes that set_table_name
Hi all,
I just hit a big wall involving a legacy database. I''ve got an active
record class called "School" that uses "set_table_name ''old_school''" to
map to a legacy database table:
class School < ActiveRecord::Base
set_table_name ''old_school''
end
It works great, until I''m testing and I want to use fixtures.
2007 Jun 25
0
Problem with RSpec in legacy databases
Hello.
I am a newbie with BDD.
I am trying to use RSpec with some legacy tables and I use the
set_table_name method in the models.
The name of the table and the class doesn´t match.
It seems that there is no problem to load the fixture in Test::Unit, I
will use the method set_fixture_class before loading fixtures, and I
will get to the data in the fixture without problems.
But this doesn´t seem
2006 Dec 14
1
create and destroy fixture manually in method
Hi,
My test case has two fixtures and eight methods. But one of the eight
methods need one more fixture. How do I solve this? Okay, I put the
additional fixture in common place so every method has additional access
to the additional fixture. The problem is the additional fixture depend
on that two fixtures (foreign key). When I run the test, it complains
something like this:
2005 Oct 28
2
Accessing fixture
I have a very simple problem. I can''t seem to access
a the fixture by name
I have a sites.yml with:
simple_site:
id: 1
name: demo
description: A demo site
created_on: 2005-10-25 00:00:00
updated_on: 2005-10-25 00:00:00
And I have a test class as:
require File.dirname(__FILE__) + ''/../test_helper''
class SiteTest < Test::Unit::TestCase
fixtures
2006 Jan 16
2
My first test - named fixture not autoloading instance variable
I''m trying to write a test like the one at the bottom of page 148 in
Agile Rails.
I''m using rails 1.0
I''ve created the fixture correctly I''m pretty sure because the test
database table is being populated per the fixture.
I have what I think is a simple unit test:
=========
require File.dirname(__FILE__) + ''/../test_helper''
class CaseTest
2006 Jan 19
4
hash fixture access broken in functional test
I have a functional test class that uses the "topics" fixture. I
verified that the fixture is loaded into the database by doing this:
assert_equal 2, Topic.find_all.size
So I should have an instance variable called @topics and instance
variables for each of the rows in the fixture, in this case, @first and
@another. But all those variables are nil inside my test method.
Is that
2006 Apr 26
3
Test fixture syntax
OK, I know I''m doing something bone-headed, but I can''t for the life of
me figure it out.
I''ve read the test fixtures Rdoc about eight dozen times, and it says
(to me) that if I have a YAML fixture file, dogs.yml that looks like
this:
fido:
id: 1
breed: Terrier
fifi:
id: 2
breed: Poodle
Then I can include
fixtures :dogs
in my functional test, and
2009 Jul 13
1
Running a single fixture.
Hello. I need to run a single fixture on my server as part of an
update to my application. I noticed that the other tables lost their
data when I run "rake db:fixtures:load". How do I make it so that only
a single fixture runs and ignores the rest?
2006 Jun 13
2
Locating an arbitrary fixture...
Is there a good way to get an arbitrary fixture from the generated
fixture function?
I need a way to get one of my fixtures, I don''t care which one. It
doesn''t need to be random and could always return the same fixture.
This is part of a support function for custom assertions and it doesn''t
know what class its working on, let alone what fixture names are
possible.
2006 May 22
1
Agile Web Dev unit test fails with fixture instance variable
I''m following Agile Edition 1. On page 148 it suggests using instance
variables named after the fixture, for example:
assert_equal @version_control_book.id, @product.id
When I introduce this type of instance variable into my test, I get the
following error:
1) Error:
test_not_owner(GroupTest):
RuntimeError: Called id for nil, which would mistakenly be 4 -- if you
really wanted the
2006 Feb 08
4
Fixture question...
Ok, I''m pretty sure I''ve seen this done before. I have a fixture that
isn''t named the same as the table I want to insert the stuff into.
Whats the right way to go about this?!
Google has failed me! :(
-Nick
2006 May 09
1
leftover fixture data causing errors
Maybe I''m not getting fixtures, but... I''m having problems as I start using
fixtures in functional tests.
Data is left in my test database after running functional tests. Not the data
created by the test-method (I''m using transactional fixtures), but data from the
fixtures themselves. Fixture loading will delete & reload the data again when
the test is re-run, but
2024 Feb 21
1
Cant access home folder after 4.13.x
The users in LDAP appear as local users on my file server using the
/etc/nsswitch.conf
passwd: files ldap
group: files ldap
[root at fs ~]# getent passwd | grep kev
kev:x:10000:10001:Kev:/home/fukr/kev:/bin/bash
[root at fs ~]# getent group | grep kev
net-users::10001:kev
net-admins::10000:kev
media::10002:kev
Kerberos is working fine, so is NTP and DNS.
My problem is that my issue
2006 Jan 05
1
Fixture files for inserting tree like behavior doesn''t work
Hi folks around, hope you could help me with my problem.
I have a porblem while testing my Acts_as_Tree behavior with fixtures.
Because all data in the fixture file will be commited at the end the
entries I want to map my tree like structure to will not be present at
this point. Due to this I get a foreign key constraints fails from the
database. Is there any way to solve this problem?
Here
2011 Dec 25
1
Fixtures vs Fixture class, what is the intended purpose?
Hello,
i am trying to fix the code for fixtures in rails because it is buggy
and internal variable names are confusing, could somebody please explain
to me what is the intended purpose of Fixture and Fixtures classes
respectively?
For example, why do we need both `Fixtures.initialize`and
`Fixture.initialize`? They both "initialize" a single fixture, and in
fact `Fixture.initialize`