similar to: Before I write this myself, is there already an easier way?

Displaying 20 results from an estimated 4000 matches similar to: "Before I write this myself, is there already an easier way?"

2006 Jan 20
6
Pre-populate db with yaml outside of testing?
Hi. What is the best way to pre-populate your database with records while developing, not testing? For example, I want to: 1) > [run this command to populate db] 2) > ruby script/server 3) now I can surf to localhost:3000 and my app will already have relevant data I''m hoping to use yaml to suck it in. Is there a way to use the Fixture class to handle this even though this is
2006 Jul 24
3
Creating performance test fixtures from development db? How?
Hi all! I''m looking into the testing chapter of Agile Web Development With Rails (2nd ed.). I want to performance test my app, but I''m too lazy to write fixtures for performance test. I''d rather use the data from my development db (because the data is so close to the production data). How do I get the data into the test db without writing fixtures? Could you please
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and often do: rake load_fixtures... ... in order to populate my development database with fun data. Now, with any HABTM relationship, there are failures, as there is no way to say "which" fixtures to load first. Within an actual functional or unit test case, you could simply load them in the proper order, but
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
2005 Nov 10
6
Manually loading fixture data
Hi all, I''ve got some tables with fixed amounts of data in them (a "states" table, for example). For tables like this I can easily put *all* of the data in the fixture. For general futzing purposes, and for those times I want to reload a database from scratch outside of testing (for whatever reason), what''s the best approach? I thought perhaps ActiveRecord::Base had
2006 Nov 24
7
Anyone know whats going on with PostgreSQL async_exec errors?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Anyone know what''s going on with ActiveRecord Edge and 1.2RC1 unit tests. I get 13 failures from the "async_exec" method call. ie: test_callback_rollback_in_save(ConcurrentTransactionTest): ActiveRecord::StatementInvalid: NoMethodError: undefined method `async_exec'' for #<PGconn:0xb75a8754>: SET
2006 Feb 16
2
fixtures outside of rails
Is there an easy way to use fixtures outside of a rails app? I''m using activerecord for a project and would love to use fixtures as well, but I haven''t found any info on doing this. I''m hoping it''s something quick and simple someone can explain to me so I don''t have to dig through the rails source :) -- Posted via http://www.ruby-forum.com/.
2005 Dec 23
2
SQLite in-memory
I left ":memory:" in database.yml for testing and the most simple tests in the Agile book do not work (see trace below for test_truth). Since that''s what comes with the distributed database.yml I suppose it''s me doing something wrong. Did someone get SQLite ":memory:" working? How does it grab the schema? -- fxn % rake test_units (in
2006 Nov 25
2
RSpec 0.7.3
Hi all, I just released RSpec 0.7.3. It''s got a few bug fixes and the rails plugin *should* run against both Rails 1.1.6 and 1.2.0-RC1. If you run into problems, please report bugs and feature requests in the tracker at rubyforge: http://rubyforge.org/tracker/?group_id=797 Cheers, David
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi I just did an update to lates trunk ================= context "Given a generated venue_spec.rb with fixtures loaded" do fixtures :venues specify "fixtures should load two Venues" do Venue.should have(2).records end end ================== gives me ========== 1) TypeError in ''Given a generated venue_spec.rb with fixtures loaded fixtures should load two
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
2007 Jul 22
18
db:fixtures:load order
I was trying to deal with foreign key issues related to order of fixture loading when I came across this: http://techpolesen.blogspot.com/2007/04/rails-fixture-tips.html This got me looking deeper into rails and I noticed that db:fixtures:load calls Fixtures.create_fixtures once for each fixture file. However, Fixtures.create_fixtures is capable of taking multiple files and also handle the
2006 Nov 24
13
rSpec on Rails 1.2?
I just updated my Rails install to the most current Edge and my controller specs fail: 1) TypeError in ''The User Controller should be a user controller'' can''t convert nil into String Each spec fails the same way. <context string> <spec string> can''t convert nil into String Any ideas what''s up with this? Thanks, s.ross
2006 Jun 24
5
Rake vs Ruby for running tests (error discrepency)
I''m having (to me) a strange problem with errors when running my tests with rake as opposed to using ruby. If I do rake test:units I get this error for several tests, but not all: 13) Error: test_player_has_game_statistics_for_season(PlayerSeasonTest): ActiveRecord::StatementInvalid: Mysql::Error: Duplicate entry ''22'' for key 1: INSERT INTO positions (`name`, `id`,
2007 Sep 21
1
Do fixture_scenarios and RSpec peacibly coexist?
Railsters: I just installed fixture_scenarios ... http://fixture-scenarios.googlecode.com/svn/trunk/fixture_scenarios ...into a project with some RSpec specifications. They all went kablooey. I didn''t even create a scenario; the system just started calling its version of fixtures(). The normal tests pass and the RSpec ones unanimously emit: TypeError in ''Context (verbose
2006 Feb 04
2
CIA question
Hi, I''d like to set up CIA. So I added the plugin to my app, went to my subversion server, added the post commit, added a build directory. I checked out the code in the build directory on the svn server. However, running rake on it fails, because the test database is empty (i.e. no tables, so fixtures don''t load). What''s the solution here?
2006 Jan 02
3
rake test_units not loading any fixtures
Hello All, If I run my unit tests individually using Ruby, they all work correctly. However, if I try to run them using "rake test_units", I get a bunch of error messages. The error messages appear to be caused by rake not loading any of the fixtures into the test database. I am using PostgreSQL on Windows. Does anyone have any suggestions? Many thanks, Bruce. -- Posted via
2008 Jun 05
23
unit test question
In development and production, I''ve got postgresql constraints that prevent deleting a CaseManager if there is a Client that belongs to that CaseManager. In unit tests...and obviously in my testing db, those restrictions don''t get added. Is it wrong to test for deleting dependent records in unit tests? Craig --~--~---------~--~----~------------~-------~--~----~ You received
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 Feb 06
9
tests fine, but fail under rake
Hi there, So I have an odd error at the moment that only occurs when I run tests via rake. It''s happening with two tests now. Under a simple ruby run, the tests are fine, e.g.: D:\User\Code\ruby\prometheus>ruby test\functional\story_comments_controller_test .rb Loaded suite test/functional/story_comments_controller_test Started ......... Finished in 2.37 seconds. 9 tests, 65