Displaying 20 results from an estimated 60000 matches similar to: "Constants in models are initialized before fixtures are loaded?"
2006 Jan 11
3
Test fixtures not loaded
I have a problem with test fixtures. The data from the fixtures is
loaded into the db (MySQL) but the variables in the test cases are not
present. The logfiles contain nothing looking like an error.
Any hints what I could have done wrong? Or how to debug this situation?
thanks
Frank
2007 Oct 21
13
[ANN/RFC] Rathole, a fixtures extension plugin
Like lots of other folks, I''ve been searching for a way to scratch my
fixture itches. Rathole is my extraction of a few techniques we''ve
successfully applied at my day job.
We''ve been using Rathole for a month or so now, but I''d really like
some feedback from a wider audience. Rathole tackles:
* Conflicting PK''s (no more id''s in fixture
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
2007 Apr 03
1
functional test, fixtures should load by myself ?
rails version: 1.2.3
ruby version: 1.8.5
----
functional test, fixtures should load by myself ?
class FooControllerTest::Test::Unit::TestCase
fixtures :foo, :bar
def setup
setup_with_fixtures # <--- must call this ?
end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 Feb 07
4
rspec fixtures stay in the test db - is this right?
I have some fixtures set up to put a few records in some of my tables.
In some of my rspec describe blocks, i''m *not* calling the fixtures, and
expecting the tables to be empty. But they''re not - the fixture data is
in there.
Am i using fixtures wrongly? I thought that the db was wiped at the
start of every test and the fixtures were only added if asked for. Is
that not the
2011 Aug 10
1
How to stop Rspec loading my Cucumber fixtures
I have a bunch of fixtures designed to populate the database for my Cucumber
integration tests.
But at this stage I want my database to be empty when using Rspec.
So, I moved the fixtures from `/spec/fixtures` to
`features/support/fixtures`, and updated `features/support/env.rb` to read:
Fixtures.reset_cache
fixtures_folder = File.join(RAILS_ROOT, ''features'',
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 Jun 13
2
Delete the fixtures on a functionnal test
Hi,
Since couple a day, I block with the delete of my fixtures in my
functionnals test. In my controller, I need test a redirect if there
are no value.
But i load my fixtures in start of my test and in a specific test I
want delete all. Only in this method, not in other method. In API, I
discover the method delete_existing_fixtures, who seem the good
practice, but I can''t find how use
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:
2008 Jul 20
10
STI and fixtures
Hi all !
Loading fixtures doens''t seems to associate my 2 objects, do know what''s
wrong ?
In app/
class Manager < Employee
has_many :employees,
:foreign_key => :reports_to
end
class Employee < Person
belongs_to :manager,
:foreign_key => ''reports_to''
end
class Person < ActiveRecord::Base
belongs_to :address
end
fixtures for
2006 Oct 17
3
rake -T is missing rake db:fixtures:dump?
Subject says it all: rake doesn''t know about db:fixtures:dump. When I
try, I get this:
Don''t know how to build task ''db:fixtures:dump''
I thought this was a standard feature that ships with rake- any idea
why it''s missing, and how I can reinstall it?
Here''s the environment:
Ruby version 1.8.4 (powerpc-darwin8.6.0)
RubyGems
2009 Mar 28
10
Use fixtures within fixtures?
Heya,
I''m using globalize2 and have following problem with my fixtures:
categories.yml:
one:
parent_id: two
color: #ff00aa
two:
color: #00ff11
three:
parent_id: two
color: #ab00ab
category_translations.yml
one-en:
id: one
locale: en
name: Cars
one-es:
id: one
locale: es
name: Coches
two-en:
id: two
locale: en
name: Start
two-es:
id: two
locale: es
2008 Mar 12
2
2.0 Fixtures with has_many :through ??
hi!
did anyone get the new fixtures features (no join table, no ids) for a
has_many :through assocation running?
I did everything like I saw in a couple of screencasts and tutorials,
but they were all using a habtm association - what do I have to change
to get it to work with a has_many :through?
google didn''t brought any results and a question in the rails forum by
someone else with
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 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
2008 Feb 11
6
Should I Test My Fixtures?
I have a number of fixtures in my test suite. For example, with
acts_as_authenticated and acts_as_state_machine, I created a number of
users in different account states for use in functional testing.
(Suspended users can not log in, etc)
Is it a good idea to run fixtures through tests to ensure that they
conform to their ideals?
EG: assert users(:suspended_user).suspended?
If so, where should
2007 Jun 27
5
Mosquito Fixtures Won''t Load
I can''t get fixtures to load correctly in a Mosquito test. The first
fixture loads in the unit test, but the rest don''t load at all.
File structure:
tracker/
tracker.rb
test/
test_tracker.rb
fixtures/
tracker_measurements.yml
tracker_projects.yml
Relevant test code:
require ''rubygems''
2007 Sep 04
3
Model Specs: Fixtures vs Mocks + Stubs?
What is the general opinion about fixtures versus mocking and stubbing
in model specs? I heard from agile on IRC that they save the database
testing for integration testing, but I also see that the caboose
sample applicaiton uses fixtures. I also noticed that on the rspec
site, it says "Ironically (for the traditional TDD''er) these are the
only specs that we feel should actually
2008 Jun 03
3
Fixtures Error With Rails 2.1 (and 2.0.2)
I have begun to use the reference function feature of sexy migrations,
and I have noticed that the fixtures are actually not playing nice
with this new feature.
If I create a model, whose table has this line:
t.reference :user
the fixure will look like
one:
user:
when it should be user_id, now, it may be possible (I don''t know, to
define an object in the fixtures now, but when I run