Displaying 20 results from an estimated 20000 matches similar to: "Add fixtures Class mothodes"
2005 Dec 12
2
Using a lib in YAML fixtures
I''m using the runt library [1] to do some temporal expression
matching. I want to keep the expression in a binary field in my db.
I figured that then in order to do the fixtures, I''d need to do some
erb in the yaml file. So I came up with this:
onetime:
id: 1
name: One Time
description: This event occurs only one time.
timex: <%= REYear.new(7) & REMonth.new(24)
2006 Jul 18
1
Fixtures Max Size? SystemStackError: stack level too deep
Hello,
I have a table of zipcodes that I am using in my application, so there
are approximately 50,000 rows in this table. I have dumped the table to
a fixture yaml file to represent this data, but when I try to load it, I
get this error: SystemStackError: stack level too deep
Is there a max size allowed for a fixture file..?
Here is the --trace output:
rake db:fixtures:load --trace
**
2006 Jan 24
0
Fixtures subdirectories
Hi,
[This is a repost, I can?t find where went my previous post,
]
I wanted to create subdirectories in the fixtures directory in order to be
able to manage many different initial states for my system (or to sort
fixtures / corresponding model subpackages).
I came up with the idea of writing:
Test::Unit::TestCase.fixture_path = RAILS_ROOT + "/test/fixtures/selling"
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 test fixture for one test method only
2007 Jun 15
3
Error when running functional test - Errno::ENOENT
Hello,
I''m getting an error when running functional tests as follows, using
Mac OSX 10.4.9, Rails 1.2.3 .
When I run:
ruby test/functional/campaign_controller_test.rb
I get this error:
Started
E
Finished in 0.027402 seconds.
1) Error:
test_should_get_icon_data(CampaignControllerTest):
Errno::ENOENT: No such file or directory - /usr/src/projects/myproject/
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 much,
2012 Mar 22
1
Rspec not loading fixtures
I am taking over a code base and am trying to run the tests. I am
somewhat new to RSpec so this might be a trivial problem.
Basically I can tell that the fixtures are not getting loaded. All 100
tests fail with a similar error.
But I don''t know why. Below is the code, with my narrative with ***
before it... Can you see anything or give me a clue where to look. So
far I am coming up
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
fixtures_folder = File.join(RAILS_ROOT, ''features'',
2006 Jan 06
4
Design flaw with Fixtures?
I''ve been trying to add unit testing for collection of models with
complex relationships -- and failing miserably.
Because of the complexity of the relationships, I''m using a database
which validates foreign key constraints (PostgreSQL 8).
I''m finding it nearly impossible to generate tests that are independent
of each other. The basic problem is the DELETE then
2007 Apr 02
0
Fixtures.create_fixtures with any desired filenames?
Hi all
I''d like to create fixtures using
Fixtures.create_fixtures
But it seems that this one needs .yml files that have the same name like
the table they correspond to:
countries.yml => my_db.countries
readers.yml => my_db.readers
Is it possible to use any desired filenames somehow?
some_cool_countries.yml => my_db.countries
some_other_cool_countries.yml =>
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed.
CHANGES
-------
Revision 8649 committed by gbuesing on 2008-01-16 20:07:10
Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002
M /trunk/activesupport/CHANGELOG
M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb
M /trunk/activesupport/test/core_ext/date_time_ext_test.rb
TEST FAILURES AND
2007 May 21
2
Rails'' fixtures suck! But what about something like this?
Sorry about the very long email, but this is a hairy topic that''s been
annoying me for some time and I decided to try to do something about.
Also, if you got this twice, I apologize too, but it didn''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
2009 Feb 02
2
looking for help with NoMethodError: undefined method `key?' for #<String:0x4795488>
Hi all,
Any help with this would be appreciated. I''m using instant rails,
updated to 2.2.2, on Windows XP.
I''ve created my DB and scaffolded a few things and put some fixtures
into place, and when I run the tests I get many errors that look like
this:
---------------------------------
1) Error:
test_the_truth(EntityTest):
NoMethodError: undefined method `key?'' for
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
2007 Jun 27
5
Mosquito Fixtures Won''t Load
I can''t get fixtures to load correctly in a Mosquito test. The first
fixture loads in the unit test, but the rest don''t load at all.
File structure:
tracker/
tracker.rb
test/
test_tracker.rb
fixtures/
tracker_measurements.yml
tracker_projects.yml
Relevant test code:
require ''rubygems''
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 allow you to directly
import one, or all of
2006 Nov 23
0
TypeError on loading fixtures for integration tests
Functional tests properly load fixtures, but my integration test
chokes:
# def self.create_fixtures(fixtures_directory, table_names,
class_names = {})
# puts("fixtures dir: "+(fixtures_directory.nil? ? "nil" :
fixtures_directory))
It''s only nil for my integration tests. I''m on rails edge. Does anyone
know what I''m doing wrong here?
1) Error:
2007 Jun 03
0
fixtures outside of rails
Hi,
Is anyone using fixtures in unit tests for applications using
ActiveRecord outside of rails? I found an example to do this from some
old threads. They cite as an example:
http://opensvn.csie.org/ezra/rails/ez_where_two/test/test_helper.rb
However, I copied this exactly and can still not get fixtures to work by
putting ''fixtures :my_model'' at the top of my test class. They
2006 Jul 10
1
rake db:fixtures:load FIXTURES=xyz
I am attempting to do selective fixture loading against my test
database.
When I run
rake db:fixtures:load FIXTURES=DataSetInfo
I get no output. (A full trace is below). I''m trying to figure out why
nothing happens.
1) Does the command above attempt to operate against my test database?
2) DataSetInfo is the name of my table and the name of my yml file
I generated these YAML
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