similar to: what is proper way to load lookup/reference data into test database?

Displaying 20 results from an estimated 10000 matches similar to: "what is proper way to load lookup/reference data into test database?"

2009 Jul 13
6
first app on Dreamhost with Passenger : "rails needs to know your username and password" ?
I am trying to deploy my first rails app with Dreamhost. I ftp''d over my existing app, turned on Passenger and pointed it to my /public directory. When I go to ''www.mydomain.com'' I get the ''Ruby on Rails: Welcome aboard'' default page, including the following: Getting started Here’s how to get rolling: 1. Create your databases and edit
2009 Jul 11
3
Migration in Multiple Database
hello to all I been working on this from past few days. .I am talking about separate migration for each one of the multiple database that a single rails application has connection with.I know that rails can work with multiple databases but what with migrations for e.g my main rails application has a connection to two databases 1> main_development 2> secondary_development Know suppose i
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
2007 Feb 14
2
File into database migration
Hi, I am trying to figure out an approach to load in our initial data into our database. I have written some load_data migrations which populate a lot of the stuff, how some of the database items are images etc and I am trying to figure out how to approach added them to the database during a rake db:migrate I am thinking if I store the files in a folder off the RAILS_ROOT I should be able to
2009 Nov 20
3
Proper usage of identify(label)
I was reading this page: http://api.rubyonrails.org/classes/Fixtures.html#M000326 and was trying to get hashed labels working. However, calling it from within a unit test results in this error: def test_defaults_to_disabled identify(''one'') end 2) Error: test_defaults_to_disabled(AdminTest): NoMethodError: undefined method `identify'' for
2006 Mar 27
5
Fixtures, Postgres & Constraints
Anyone have any tips for handling postgres constraints when using fixtures to load the database, other than to sort out the proper insertion orders or leaving the constraints out? I''d prefer not to do the former since I''d rather use my app to generate my fixture data (using a dump_fixtures task) and I''d prefer not to do the latter because leaving out constraints till the
2006 Jul 02
1
seeding a database
Hi, I have set up my Rails app to use Migrations. At the end of the migrations the database is empty. I would like to do something, a single step, after the migrations to seed the data so I can click around my site and see some actual content. What is the best way to do this? Thanks, Peter
2006 Aug 14
18
[OT] The bad idea that is storing Credit Cards in your database
Hello Railists and Rubyists, I know that the topic of handling credit card numbers has been expounded before on this list (I''ve searched the archives) but I want to ask the question in a slightly different way, and get your feedback: Previous discussions on the list center around what to do with the card number *after* you have processed the credit card with a payment gateway
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
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
2006 Apr 07
3
*dont* empty the database...?
I''d like to test against a very large dataset - is there anyway to prevent the data in the test database being destroyed on each test run? storing the dataset in fixtures causes the tests to take several minutes to complete, even using csv fixtures, and that''s just for one test case! I''d appreciate any suggestions on how to preserve the data in the test database
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
2005 Dec 14
3
Plugin w/ Migrations and/or Fixtures?
I''m working on a plugin which needs to add both schema and data to the app database, and I''m trying to figure out the best way to do it. I''d like to use a db migration to modify the schema and load the data from a YAML fixture, but Rails doesn''t seem to support migrations for plugins. To do so, the schema_info table would need to change to include a
2006 Jun 29
14
TDD and migrations?
TDD, SVN and migrations seem to be a natural combination for model development: create a test, add the column with a migration, write the code, and check it all in when you''re done. The trouble is that this ends up creating one migration per field. I guess it''s not horrible in and of itself, but it does have a code smell to it. Has anyone come up with a different way of doing
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
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
2006 Jun 11
4
Model records are not saved to database in during tests
Hi, I''m trying to do unit tests which should save informations into a database that another computer should be able to get while the test is running. The problem is although my unit test class has "use_transactional_fixtures" set to false, when I create a new instance of a model and save it, it does not actually appear in the database when connecting to this same
2006 Apr 28
2
Rails and Firebird
Hello! I''m new to Ruby and Rails, but have been reading along here, and searched the archives and didn''t see anything addressing some concerns I have with using Rails and Firebird. I prefer Firebird when it is available, and I''m very pleased to see that others have gotten it working with Ruby. I have been trying to use it with Rails, with mixed success.
2006 Jul 10
8
Setup new data in the test database _after_ unit test runs
All, I want to run automated unit tests as part of my build. I am building to my test environment. Upon successful completion of all of my unit tests, I would then like to load some data (using a fixture, I imagine) into my test database that will act as fresh "system test" data for my users to play with. What is the best way to "load the standard system test/user acceptance
2009 Jan 27
2
using Sweave with a master file that has several iputted .tex files
Suppose I have a Master.Rnw file that looks something like this: \documentclass[12pt]{mypaper} \usepackage[margin=1in]{geometry} \usepackage{setspace} \usepackage{url} \usepackage{indentfirst} \usepackage{fancyhdr} \usepackage{Sweave} \pagestyle{fancy} \lhead{sonographic rectal diameter and ADHD} \rhead{ } \usepackage{abbrevs} %\usepackage{natbib} %\usepackage{apacite}