search for: delete_existing_fixtur

Displaying 11 results from an estimated 11 matches for "delete_existing_fixtur".

2007 Jun 13
2
Delete the fixtures on a functionnal test
...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 it. I have always the information of method not found. So I want know if anyone has an information for delete my fixtures in a test. thanks -- Cyril Mougel --~--~---------~--~----~------------~-------~--~----~ You received this m...
2006 Mar 01
1
maddening intermittent failures in unit tests with "working" code
...al_fixtures = true self.use_instantiated_fixtures = false # From http://rails.techno-weenie.net/tip/2005/11/20/log_within_tests def logger RAILS_DEFAULT_LOGGER end end # from http://wiki.rubyonrails.com/rails/pages/DisableForeignKeyChecksUnderMySql class Fixtures alias :original_delete_existing_fixtures :delete_existing_fixtures alias :original_insert_fixtures :insert_fixtures def delete_existing_fixtures @connection.update "SET FOREIGN_KEY_CHECKS = 0", ''Fixtures deactivate foreign key checks.''; original_delete_existing_fixtures @conn...
2006 Jan 10
5
problems overriding module with plugin
Hi I am trying to create a plug-in to fix the error in the rails core produced by the multiple delete on a HABTM relationship. I have confirmed that my plug-in is being included into the base during runtime however the code does not seem to be overridding the base class. module ActiveRecord module Associations module ClassMethods def has_and_belongs_to_many(association_id, options =
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
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
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
2005 Dec 30
1
Problems with Testing (Depot) demo app in Agile Rails book
...ecord/connection_adapters/mysql_adapter.rb:180:in `execute'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:195:in `delete'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:279:in `delete_existing_fixtures'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:252:in `create_fixtures'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:252:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib...
2007 Apr 01
7
database.yml: encoding: utf8 does not work
Hi all According to the Agile 2nd Ed book I added the line encoding: utf8 to my database.yml connections. But now when running rake I get plenty of errors: Character set ''utf-8'' is not a compiled character set and is not specified in the ''/usr/local/mysql/share/mysql/charsets/Index'' file What''s wrong here? I checked this Index file, but it seems to
2006 Sep 05
0
rake craziness with Migrate as a dependency
...ib/active_record/connection_adapters/mysql_adapter.rb:184:in `execute'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:199:in `delete'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/fixtures.rb:283:in `delete_existing_fixtures'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/fixtures.rb:256:in `create_fixtures'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/fixtures.rb:256:in `create_fixtures'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/ac...
2011 Jul 25
4
Rails 3 test database issues
I am having a problem using the test database in Rails 3. It apparently has kept track of aspects of the database that I deleted completely from my migrations at some point. I don''t always use the ''down'' part of a migration and sometimes just recreate the whole database. I did rake db:migrate:reset and rake db:test:prepare, but when I run my test it is trying to access
2006 Apr 17
20
Rubricks - CMS on Rails
Hi list, I made an open source CMS powered by Rails, named Rubricks. I have a web page for Rubricks. You can download it or view a flash demo there. Please try them and feed me back, like bug report etc. Check it out at: http://rubricks.org/index_en.html Thanks. Shouta