search for: fixtures

Displaying 20 results from an estimated 798 matches for "fixtures".

2005 Nov 26
4
activerecord rake test_mysql
...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 $RAILS_HOME/activerecord\test\fixtures\db_definitions\mysql.sql on activerecord_unittest ran $RAILS_HOME/activerecord\test\fixtures\db_definitions\mysql2.sql on activerecord_unittest2 modified $RAILS_HOME/activerecord\test\connections\native_mysql/connect.rb accordingly I removed all my local changes, so I''m running with a pr...
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 correct order for both deletes and inserts, so I created a new rake task that handles deletes/inserts in the correct order based on ENV[''...
2006 May 09
2
load fixtures
I''m finally getting beyond using basic test fixtures, and a few questions have popped up. Has anyone found ways to do these? 1. Use a test fixture that is named differently from its table name? We''d like to have more than one possible fixture per table. (Or perhaps use test fixtures named similarly but in different directories.) 2. Load a...
2007 May 21
2
Rails'' fixtures suck! But what about something like this?
...''t seem to have successfully gone out the first time. Background: ---------- I''ve been dealing with Rails for about a year and a half now. I''ve been using Rails'' built in testing framework, and it''s fine... until I really have to start dealing with the fixtures. I am currently working on an application that really focuses on selecting data using complex logic. The only way to test the application in a meaningful way is by using a large number of fixtures. This has become a real nightmare to manage and I almost am spending more time keeping the fixtures up...
2007 Apr 17
3
using rake db:fixtures:load with rspec fixtures
Hi, I''m new to rspec. I have some fixtures in /spec/fixtures. If they were in /test/fixtures they could be loaded with rake db:fixtures:load. Is there any way other than a symlink to load my rspec fixtures into the database with rake? Or, can I cause rspec to load the fixtures from /test/fixtures? Thanks, Paul
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
...ctive_record/connection_adapters/postgresql_adapter.rb:407:in `execute_without_counting'' ./test/abstract_unit.rb:71:in `execute'' ./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:140:in `insert_fixture'' ./test/../lib/active_record/fixtures.rb:634:in `insert_fixtures'' ./test/../lib/active_record/fixtures.rb:571:in `each'' ./test/../lib/active_record/fixtures.rb:571:in `insert_fixtures'' ./test/../lib/active_record/fixtures.rb:519:in `create_fixtures'' ./test/../lib/active_record/fixture...
2011 Aug 10
1
How to stop Rspec loading my Cucumber fixtures
I have a bunch of fixtures designed to populate the database for my Cucumber integration tests. But at this stage I want my database to be empty when using Rspec. So, I moved the fixtures from `/spec/fixtures` to `features/support/fixtures`, and updated `features/support/env.rb` to read: Fixtures.reset_cache f...
2007 Aug 08
1
Transactional fixtures not working as expected
Hi! I am quite new to BDD and I just wrote my first tests. Suddenly I received unexpected results because in a model test I load only users-fixtures but when the views-fixtures in which I load the posts-fixtures, are run before this model-test, the posts-fixtures are loaded too. I test for example if there is one record in the posts-table after creating one post. But when there are fixtures loaded, this does not work of course. A similar issue...
2006 May 09
1
leftover fixture data causing errors
Maybe I''m not getting fixtures, but... I''m having problems as I start using fixtures in functional tests. Data is left in my test database after running functional tests. Not the data created by the test-method (I''m using transactional fixtures), but data from the fixtures themselves. Fixture loading will dele...
2007 Dec 01
10
Fixtures Cleanup
All, I''ve been playing a bit with some patches to make the fixture loading and management code a little bit easier to maintain. If I were to start chopping out features, how would you feel about losing: Fixture instantiation, Old school single-file fixtures, CSV fixtures, The ability to specify a subset of fixtures (everything''s always loaded instead), The ability to disable transactional fixtures, or intrafixture ordering (OMap). I''m not suggesting that any of these should necessarily disappear: I''m just interested in...
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
2011 Dec 25
1
Fixtures vs Fixture class, what is the intended purpose?
Hello, i am trying to fix the code for fixtures in rails because it is buggy and internal variable names are confusing, could somebody please explain to me what is the intended purpose of Fixture and Fixtures classes respectively? For example, why do we need both `Fixtures.initialize`and `Fixture.initialize`? They both "initialize" a...
2006 Aug 03
2
Including ALL fixtures for a test
...nal tests because they need info from almost every single table in the database. I have long laundry lists of fixture names to include on these test files and then I have to troubleshooot bizarre test failures because of a fixture that was not included. So is there a way to simply include all fixtures in a test? Something like: fixtures :all would rock my socks, but doesn''t work. Is there a way to include all fixtures? -- Posted via http://www.ruby-forum.com/.
2005 Oct 28
2
Accessing fixture
...I have a sites.yml with: simple_site: id: 1 name: demo description: A demo site created_on: 2005-10-25 00:00:00 updated_on: 2005-10-25 00:00:00 And I have a test class as: require File.dirname(__FILE__) + ''/../test_helper'' class SiteTest < Test::Unit::TestCase fixtures :sites, :contenttypes, :contentitems def setup end def test_create puts @sites puts @sites["simple_site"] end end When I attempt to print out the fixture I just get nil. I thought you reference the fixture as an instance variable with...
2006 Jan 16
2
My first test - named fixture not autoloading instance variable
...9;'ve created the fixture correctly I''m pretty sure because the test database table is being populated per the fixture. I have what I think is a simple unit test: ========= require File.dirname(__FILE__) + ''/../test_helper'' class CaseTest < Test::Unit::TestCase fixtures :cases def setup @case = Case.find(1) end # Replace this with your real tests. def test_verify_schema_has_correct_fields assert_kind_of Case, @case assert_equal 1, @case.id assert_equal "F-06-101", @case.case_number assert_equal @first.case_number, @case.case_n...
2006 Mar 28
2
Testing STI models
...! I have a question: what is the preferred way (in terms of simplicity) to test models with single table inheritance. Right now I have 1 test case and 1 fixture for all of the STI models, but it''s very hard to maintain it (too many tests and records in fixture). It would be better if fixtures could be named separately from DB tables. I know, Engines plugin has it''s own "fixture" helper that allows class and table name to be specified for particular fixture. Will it sometime become a standard (and be included in Rails) or there are other ways / thoughts on this ?...
2004 Dec 09
3
fixture problem, TypeError: nil is not a symbol
When I run rake against Rails 8.5 to test unaltered model tests with yaml fixtures I get the error and stack trace reproduced below for every one of my model objects. Has anyone seen something this before? Any idea what could be going on here? The following ruby-talk thread may or may not be relevant: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/95301. Thanks...
2006 Dec 14
1
create and destroy fixture manually in method
Hi, My test case has two fixtures and eight methods. But one of the eight methods need one more fixture. How do I solve this? Okay, I put the additional fixture in common place so every method has additional access to the additional fixture. The problem is the additional fixture depend on that two fixtures (foreign key). When I run...
2007 Sep 07
4
fixtures in before(:all)
I was planning on using a fixture within a description that didn''t modify the fixture, so I put it in a before(:all) block: describe "Customer", "xml" do fixtures :customers before(:all) do one = customers(:one) end # ... As a result, I got this message: 1) NoMethodError in ''Customer xml before(:all)'' You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred whil...
2006 Jun 10
5
[REL] Manage Fixtures 2.0.0
Just released a new version of the _Managed Fixtures_ plugin, previously known as _Export Fixtures_. The name change comes with some added functionality for managing the fixtures, primarily with two new import tasks for importing specific Models or all of them within the test/fixtures directory. Both new import tasks take the exported fixtures, and...