search for: clone_structur

Displaying 17 results from an estimated 17 matches for "clone_structur".

Did you mean: clone_structure
2008 Dec 05
0
test:clone_structure problems with Postgres
(in C:/projects/books/TheatreTickets) ** Invoke db:test:clone_structure (first_time) ** Invoke db:structure:dump (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:structure:dump ** Invoke db:test:purge (first_time) ** Invoke environment ** Execute db:test:purge ** Execute db:test:clone_structure psql:db/development_structure...
2007 Jun 25
0
db:test:clone_structure doesn''t purge db
...SET=utf8" option in my migrations, but this isn''t dumped to schema.rb - a file that test:db:clone uses to create the test database. The end result is some of my specs fail because they''re expecting the db table to be using utf8. to get round this, I switched to using db:test:clone_structure which DOES preserve the charset option, but when the test db is created using this method, the db isn''t emptied between specs. e.g. If my before method creates an object, and the spec has 8 examples, by the time the last example is run there are 7 objects in the database. This isn'...
2006 May 02
4
How to extend rails rake tasks?
Does anyone know how to extend the buit-in rake tasks like test:unit. I want to custom load some fixtures in a particular order. Thanks, Zack
2007 Oct 16
2
Primary Keys enforcement vanishes in test database
I use this naming convention for primary keys: ActiveRecord::Base.primary_key_prefix_type = :table_name_with_underscore I generate the MySQL test database: rake db:test:prepare, and although the column is there there is no primary key enforcement/index and no autoincrement (so activerecord saves fail). Is this a bug? What is the best workaround? Alan
2006 Apr 03
2
problems testing on 1.1 and postgresql
Hi, I get errors doing this: 1) createdb myapp_test 2) rake db:test:clone_structure 3) rake test:units rake aborted! PGError: ERROR: relation "matches" already exists I''m using the :sql schema format because there are some problems with postgres and the :ruby schema format config.active_record.schema_format = :sql It seems rake test:units is trying to c...
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 Apr 11
6
Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1.14
I''ve upgraded to Rails 1.1.2, and I''m trying to push this change through to our build server (Linux/Oracle) and we are getting some errors in the unit tests using Oracle. Looking at the data in the tests reveals a precision problem. Looking at the tables tells the whole story. My development database contains this table: SQL> describe dls_grids; Name
2006 Aug 23
1
problems with Oracle: FK, triggers
Hi All! Is anyone working with Oracle on Rails? What about testing? I will be very happy if you can help me: 1) When I run rake test:unit it removes all my sequences in test enviroment. And I get an error like "OCIError: ORA-02289: sequence does not exist" But when I run rake db:test:clone_structure I can see all sequences again. Where is a problem? 2) How I can take proper account of triggers? Now I just can''t run some test because this action suppose to drop a data (and I have a trigger on DELETE event). Unforunately I couldn''t find any good documentation about Oracle...
2006 May 28
1
Unit tests hitting development database, not testing...
I''ve been working through the AWDWR book (both hard copy first edition and "beta book" pdf of second and I''m running into some problems when running unit tests. Integration tests and functional tests are behaving correctly and are operating against the test database. However unit tests try to operate against the development database and fail. (ie rake test:unit
2006 Oct 19
0
Migrations, superusers, security and least privileges
...it (or knows an existing way to accomplish the same thing). Here''s the scenario: - I always create specific database users that only have CRUD priveleges, and run my web apps with these users - I need to log in with a superuser to run migrations and other test functions (like clone_structure) - I never want to store a superuser database password, encrypted or not, in any of my database.yml files - I don''t want to have to modify database.yml everytime I deploy, type in superuser credentials, migrate and then change them back Here''s my ideal scenario:...
2007 Jun 08
1
JRuby and tests
Using JRuby / ActiveRecord-JDBC / PostgreSQL 8.1 I get jruby --command rake test (in /Users/stevel/Publisher) rake aborted! Task not supported by ''jdbc'' Is it really the case that testing is not yet supported by ActiveRecord-JDBC or am I missing something obvious? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2006 May 29
2
foreign keys and referential integrity
Sans rails my normal approach to handling this would be to enforce it in the database and when a database operation failed I''d try to validate the model to produce an error message. It''s always served me pretty well. Rails expects you to validate before commiting but of course this does nothing to guarantee referential integrity. It''s perfectly possible for one
2006 Nov 10
2
Testing with foreign keys
I''m looking for a plugin/whatever for preloading fixtures, to run tests with FKs defined. Specifying load order just doesn''t work for me, I need to purge the test db, load all fixtures, and only then create the FK constraints. Any suggestions? Isak --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2007 Feb 03
1
Postgres + tsearch2, migrations, and unit testing
...rite the db:test:prepare task with the following: desc ''Prepare the test database and load the schema'' task :prepare => :environment do if defined?(ActiveRecord::Base) && !ActiveRecord::Base.configurations.blank? Rake::Task[{ :sql => "db:test:clone_structure", :ruby => "db:test:clone" }[ActiveRecord::Base.schema_format]].invoke end ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[''test'']) ActiveRecord::Base.connection.execute File.read( File.join(RAILS_ROOT, ''test&...
2007 Apr 17
7
rspec with CI
I am a bit of a rails and rspec noob. I am trying to use rspec in conjunction with CruiseControlrb. When I run a cruise build having spec errors, the build does not indicate a failure. I have tried to track down why this is the case, and my best guess is that the spec task is kicking off the spec via a ruby() method in rake, and that ruby method does not propagate my spec failure back to
2007 Jan 09
6
rcov seg fault
Hi Trying to get rcov going (has been working), but with the following context and specs it fails. context ''/account POST with invalid attendee'' do controller_name :account setup do Attendee.stub!(:create!).and_raise(ActiveRecord::RecordInvalid.new( Attendee.new)) end specify ''should raise on create'' do Attendee.should_receive(:create!).with({
2007 Nov 07
5
Unexplainable failure...at least for me
I have an address model with country_id and province_id fields There is also a full_address method that returns an address that is in a format that the google maps api will be able to return a long-lat coords. Within the full_address method there is a call to obtain the province/state and country name. --------- def full_address ... full_address = [city, self.province.name,