Displaying 20 results from an estimated 3000 matches similar to: "fixtures not loading when running rake test - ok other times"
2006 Jul 10
1
rake db:fixtures:load FIXTURES=xyz
I am attempting to do selective fixture loading against my test
database.
When I run
rake db:fixtures:load FIXTURES=DataSetInfo
I get no output. (A full trace is below). I''m trying to figure out why
nothing happens.
1) Does the command above attempt to operate against my test database?
2) DataSetInfo is the name of my table and the name of my yml file
I generated these YAML
2005 May 15
0
fixtures, unit tests, and rake
What are the semantics of the fixtures idea?
I have a set of unit tests that when I run individually run fine.
When I run them under "rake", the second unit test to call the same
fixture doesn''t seem to actually load the data.
That is, I have 2 tests; test1.rb and test2.rb, and each one calls
"fixtures :foo". test1 runs, by itself, then test2 fails because it
2011 Apr 06
0
test a rake with fixtures
How do a test a rake task using fixtures? I''ve written yaml files for
each fixture but I''m not sure how to test the rake using the fixtures.
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe
2007 Aug 27
7
Foreign key constraints, fixtures, and rake task
I''ve got a spec that loads a fixture in the "before" block. This works
fine running scripts/spec, but when I run rake spec instead, I get:
ActiveRecord::StatementInvalid in ''User in fixture :quentin with an IM
service but no IM name should be invalid''
Mysql::Error: Cannot delete or update a parent row: a foreign key
constraint fails
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`
2006 Jul 31
0
using Class#Find in dynamic fixtures
Hi,
I am currently coding my tests and I made a lot of fixture files. To
make everything simple (I thought), I didnt put the ID in the fixture,
insted when I needed to put the id of something, I used
Class.find_by_name "name of the item to find".
When I use the file to import data in my migration everything is fine.
But when I use the same files for my unit test, there is a
2007 Apr 17
3
using rake db:fixtures:load with rspec fixtures
Hi, I''m new to rspec. I have some fixtures in /spec/fixtures. If they
were in /test/fixtures they could be loaded with rake db:fixtures:load.
Is there any way other than a symlink to load my rspec fixtures into
the database with rake? Or, can I cause rspec to load the fixtures
from /test/fixtures?
Thanks,
Paul
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
2007 Nov 05
0
loading fixtures into oracle
Any idea why this fixture would fail to load any data?
<%
%w( Admin Pharmacist PI/Co-PI Research\ Nurse ).each { |g|
Group.create( :name => g ) }
%>
It works perfectly in irb but when I do rake db:fixtures:load I get no
data, no errors, and no error logs.
I realize my fixture doesn''t look like your typical run-of-the-mill
fixture but it''s that way because I''m
2006 Mar 14
15
in_place_editor_field -- values not clickable
Hallo -- I''ve just installed the latest stable version of rails, and am
following the rails recipies book''s first recipie -- using
in_place_editor_field.
My problem is that the code throws no error, but the resulting fields
are not editable -- the values just come up as text, rather than
clickable-then-editable fields.
Can anyone help shed any light on why this might be the
2006 May 09
2
load fixtures
I''m finally getting beyond using basic test fixtures, and a few questions
have popped up. Has anyone found ways to do these?
1. Use a test fixture that is named differently from its table name? We''d like
to have more than one possible fixture per table. (Or perhaps use test fixtures
named similarly but in different directories.)
2. Load a test fixture for one test method only
2005 Oct 27
2
Fixtures are not loading into instance variables. Why not?
Hi,
I have a fixture in a unit test and I see that the
fixture is loaded correctly into the database table,
but no instance variables are created.
So now I''m stuck.
More background: this is my first RoR project and I
have just installed the SaltedLoginGenerator and
generated its output.
Running the unit tests gives an error, so I cut it
down to just 1 test:
2006 Apr 12
0
fixtures advanced question
Hello,
in my database i have tables models,marques,cars. I wrote fixtures for
models f1:
id: 1
marque_id: 1
name: 100 NX
f2:
id: 2
marque_id: 1
name: 200 SX
f3:
id: 3
marque_id: 1
name: Almera
f4:
id: 4
marque_id: 1
name: Patrol
f5:
id: 5
marque_id: 1
name: Primera
f6:
id: 6
marque_id: 2
name: CLK
f7:
id: 7
marque_id: 2
name: CLS
f8:
id: 8
marque_id:
2011 Apr 26
1
problem populating table using rake db:fixtures:load
I''m running Rails 3 and I''m trying to populate a table using rake
db:fixtures:load, and I''m getting a "Could not find" file error.
The table is called stores, and I''ve confirmed that it exists, and the
data is in stores.yml in my test/fixtures directory. The command I''m
running is rake db:fixtures:load FIXTURES=stores.
The error message
2006 Aug 03
2
Including ALL fixtures for a test
I am running into some issues with my functional tests because they need
info from almost every single table in the database. I have long
laundry lists of fixture names to include on these test files and then I
have to troubleshooot bizarre test failures because of a fixture that
was not included.
So is there a way to simply include all fixtures in a test? Something
like:
fixtures :all
2006 Jan 06
4
Design flaw with Fixtures?
I''ve been trying to add unit testing for collection of models with
complex relationships -- and failing miserably.
Because of the complexity of the relationships, I''m using a database
which validates foreign key constraints (PostgreSQL 8).
I''m finding it nearly impossible to generate tests that are independent
of each other. The basic problem is the DELETE then
2005 Dec 12
2
Using a lib in YAML fixtures
I''m using the runt library [1] to do some temporal expression
matching. I want to keep the expression in a binary field in my db.
I figured that then in order to do the fixtures, I''d need to do some
erb in the yaml file. So I came up with this:
onetime:
id: 1
name: One Time
description: This event occurs only one time.
timex: <%= REYear.new(7) & REMonth.new(24)
2009 Dec 22
1
Rails fixtures - defining a table name?
Hi,
At the minute all my fixtures have the same name as the table that they
are intended for, because of a recent issue with rails it doesn''t seem
possible to have a fixture beginning with the word ''test''
Does anyone know of a way to have a different fixture name and then map
it to the correct table?
Thanks
--
Posted via http://www.ruby-forum.com/.
--
You received
2006 Jun 08
1
fixtures instance variable naming
hi all,
trying my first foray into testing and having trouble with accessing
the fixture instance variable
built a test for my NewsRelease model.
have a news_releases.yml as a fixture with:
first:
id: 1
title: my first release
body: this is still my first test of a news release
publish: 0
date_publication: 2006-06-06 17:28:00
in news_release_test.rb, i have
def setup
2006 Apr 17
2
binary info in test fixtures?
Hi all,
I have a shopping application I am testing, and one of the models is an
Order model, within which a credit card number is encrypted and stored
in the db (mysql) as a BLOB field. When trying to run my unit tests, I
cannot get my model fixtures to load the encrypted data.
If, in my dynamic fixture (YAML) file, I could have access to my app''s
models, the problem would be trivial..