search for: fixture_nam

Displaying 8 results from an estimated 8 matches for "fixture_nam".

Did you mean: fixture_name
2006 Jul 14
5
migration and inserting default data
Hi, I''m wondering is there a way to load default data in the migration script? So, for example I''m creating new table to store the order status, I also want to pre-populate the table with some data from a sql file. I have done a quick search on the list but cannot find anything. thanks, - reynard -------------- next part -------------- An HTML attachment was scrubbed... URL:
2011 Dec 25
1
Fixtures vs Fixture class, what is the intended purpose?
...les, and it is not called anywhere in fixtures.rb. (Maybe i''ll try to remove it and run tests, to see what happens.) I am also considering to propose changing some fixtures API, like to make the (undocumented?) class attribute `TestFixtures::fixture_table_names` to hold a Hash of `"fixture_name" => :table_name`, similarly to `TestFixtures::fixture_class_names` holding the Hash of `"fixture_name" => FixtureModelClass` (i would also propose to rename). Currently `TestFixtures::fixture_table_names` holds an Array. I am also trying to fix the meaning of `fixture_name`,...
2007 May 21
2
Rails'' fixtures suck! But what about something like this?
...half of the file. The f method is the actual method for creating a fixture. it takes a name as a string and a block in which the attributes of the fixtures are specified. However, the method_missing method is implemented to handle any missing methods and use that to create fixtures too as seen with fixture_name { ... } + Dealing with relationships I think what I hate the most about fixtures right now is having to deal with table relationships. Having to keep track of IDs myself is horrible. So, I thought that the easiest way to do this is making the table_name(:fixture_name) method available straight i...
2005 Dec 23
6
Agile book - test error
Hi all, I get an error when testing the "store_controller_test.rb" The troublesome line is in the test below: def test_add_to_cart get :add_to_cart, :id => @version_control_book.id <<< cart = session[:cart] assert_equal @version_control_book.price, cart.total_price assert_redirected_to :action => ''display_cart'' follow_redirect
2006 Jun 10
5
[REL] Manage Fixtures 2.0.0
...database. Defaults to development database. Set RAILS_ENV to override. [%] rake db:fixtures:export_for_tables TABLES=foos[,bars] Create YAML text fixtures based on a specific SQL query [%] rake db:fixtures:export_using_query SQL="select * from foo where id=''bar''" FIXTURE_NAME=foo Import the YAML test fixtures for specific models from data in an existing database. Defaults to development database. Set RAILS_ENV to override. [%] rake db:fixtures:import_for_models MODELS=Foo[,Bar,Land] Import all YAML test fixtures for all of the models from data in an existing datab...
2006 May 22
1
Agile Web Dev unit test fails with fixture instance variable
I''m following Agile Edition 1. On page 148 it suggests using instance variables named after the fixture, for example: assert_equal @version_control_book.id, @product.id When I introduce this type of instance variable into my test, I get the following error: 1) Error: test_not_owner(GroupTest): RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really wanted the
2006 Mar 30
3
Export Fixtures Plugin
...n existing database. Defaults to development database. Set RAILS_ENV to override. rake db:fixtures:export_for_tables TABLES=foo,bar Create YAML text fixtures based on a specific SQL query rake db:fixtures:export_using_query SQL="select * from foo where id=''bar''" FIXTURE_NAME=foo = BUGS Please report any bugs or feature enhancements to http://dev.toolbocks.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Nathaniel S. H. Brown? ? ?? ??? ?? ?? ?? ?? ?http://nshb.net ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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