Displaying 20 results from an estimated 10000 matches similar to: "Migrations for populating authority tables"
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
2005 Jul 06
3
populating development database from test fixtures
Hi,
Is it possible to populate the development database from the test
fixtures? I''m trying to keep the development database schema in a
plain-text sql file and modifying that when I need to modify the
database structure. However, then I have to either manually
repopulate the database or add in additional sql statements that
populate the test database.
It seems like it would be useful
2005 Dec 28
3
Unit tests, Fixtures, Authority Data, Oh my!
Yo guys...
I''m starting to get into testing my current e-commerce Rails app before I
Engine-ify it...(Codename "Substruct" - don''t sleep!)
I''ve got some data that should be loaded before each test. Convention tells
me that I should prepare this data in nice YML files as fixtures, although
I''m not quite so sure.
The data in question is a country list
2006 Jun 15
4
testing with transactions
Hello!
I experienced problems with testing transactions which are supposed to be
rolled back, but are not, because of transactional fixtures eliminating the
inner transaction. Can this be worked around somehow without turning off
transactional fixtures? Maybe savepoints can help this?
Does anyone have any experience with savepoints to achieve nested transaction
functionality? Both Postgres
2006 Apr 23
18
Applications used in the Rails video?
Hi all,
I just watched the rail video:
http://www.rubyonrails.org/media/video/rails_take2_with_sound.mov
I am just curious. I can tell that the video was done on a Mac, but I
cannot tell which applications were used for editing the code, and for
interfacing with MySQL database.
As far as editing source code, I normally use BBEdit (I''ve used it since
1994), but the editor used in
2006 May 16
4
Model class conditional on ENV["RAILS_ENV"] == "test"
I am trying to setup a model class that I want to inherit from
ActveRecord when in the test mode, and not inherit when in production
and/or development mode. The reason for this is so that I can use
fixtures to test that the logic in the model is working correctly, but I
don''t want the database table around during production (and normal
development).
I would like to do this the
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
2006 Mar 09
4
Testing Migrations
Is there some standard way to test migrations?
It seems to me that an additional safeguard for migrations would be to
test and see if applying the migrations to the test database allows one
to reconstruct the structure of the development database.
If you can''t, then there is an error in your migrations, most likely
because someone hand-modified the database without generating a
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 Apr 21
1
Using fixtures inside migrations
Hi,
I want to add data from a fixture file to a table inside a migration.
I''ve saved the file in db/migrate/fixtures/countries.yml
I guess I could just open the file, read the entries, and add them to
the database using AR, but I''m hoping I can use Rails for all that.
Also, if I have a file, say, with 200,000+ records, what would be the
best method (performance-wise) to go
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
2006 Aug 16
2
accessing a model from a migration
Hello again!
ok, i have some initial migration code which sets up my apps schema. i have a
few tables that get initialized with data in this migration where i have the
table data in yaml format in test/fixtures. i use db:fixtures:load
FIXTURES=countries,provstates,employees to initialize these tables..
here''s the wrinkle: employees when it gets loaded should only contain the admin
2005 Nov 26
4
activerecord rake test_mysql
Hi (I''m resubmitting this because
First question: This is the rails dev list, correct?
I''d like to submit a patch and am following the steps on this page:
http://dev.rubyonrails.org/
Here''s what I did (using mysql 5.0.15-nt):
created 2 databases:
activerecord_unittest
activerecord_unittest2
created 1 user: rails (giving all priveleges to both databases)
ran
2008 Jun 05
3
what is proper way to load lookup/reference data into test database?
I''m just getting into writing tests for my first RoR app. I''ve got a
few data migrations to load reference data (i.e. 2-char state abbrevs,
payment types, etc.). How do I get that data into the test database?
I understand fixtures are to load test data. But if I duplicate these
lookup tables in test fixtures, it seems like that is violating the
DRY principle. Is that OK in
2010 May 26
3
Plugin test fixtures
Just spent a good bit of time trying to figure out why I couldn''t get
fixtures to work in a plugin test. I was including
ActiveRecord::TestFixtures into ActiveSupport::TestCase and trying to
get fixtures to automatically reload for every test like regular Rails
tests.
The problem was in the first line of
ActiveRecord::TestFixtures.setup_fixtures:
return unless defined?(ActiveRecord)
2007 May 21
2
Rails'' fixtures suck! But what about something like this?
Sorry about the very long email, but this is a hairy topic that''s been
annoying me for some time and I decided to try to do something about.
Also, if you got this twice, I apologize too, but it didn''t seem to
have successfully gone out the first time.
Background:
----------
I''ve been dealing with Rails for about a year and a half now. I''ve
been using
2012 Jun 08
1
Announce: puppetlabs_spec_helper 0.1.0 Available
puppetlabs_spec_helper is a Rubygem to make writing and running module spec
tests using rspec-puppet easier. It includes a set of common rake tasks and
a spec_helper that correctly initializes puppet and rspec-puppet for
testing.
The code is available on github at
http://github.com/puppetlabs/puppetlabs_spec_helper. Patches are welcome.
To convert a module with existing spec tests to use the
2008 May 22
14
Specifying certain tables NOT to be cleared each example?
Is it possible to specify that certain tables not be cleared on each
example.
I''ve inherited a project where a good amount of enumerated data is
stored in the database (US States, statuses, about 15-20 tables worth.
Over all, it''s a reasonable decision that leads to solid production
code (acts_as_enumerated is good). This data is read-only and
relatively static; any
2007 Aug 08
1
Transactional fixtures not working as expected
Hi!
I am quite new to BDD and I just wrote my first tests. Suddenly I
received unexpected results because in a model test I load only
users-fixtures but when the views-fixtures in which I load the
posts-fixtures, are run before this model-test, the posts-fixtures are
loaded too. I test for example if there is one record in the posts-table
after creating one post. But when there are fixtures
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