similar to: Setting up Testing model, getting an error

Displaying 20 results from an estimated 1200 matches similar to: "Setting up Testing model, getting an error"

2006 Jul 06
0
problema con i test automatizzati
ciao a tutti.     come al solito, sto andando avanti a piccoli passi nel creare l''applicazione depot del libro "Sviluppare Applicazioni Web con Rails". Ora mi trovo nella fase di creazione dei test automatizzati. Ma c''è una cosa che proprio non capisco: Ho la seguente classe in ~/depot/test/unit/product_test.rb require File.dirname(__FILE__) +
2006 May 05
7
Testing model: test becomes dependent on previous test
Im having trouble with Testing models. im following the tutorials in the book Agile Web Development with Rails. if i execute the code product_test.rb, i get this error: ============================================================ 1) Failure: test_update2(ProductTest) [test/unit/product_test.rb:30]: <29.95> expected but was <99.95>. 3 tests, 11 assertions, 1 failures, 0 errors
2005 Dec 31
2
Test Unit Problem
Hello All, I am experiencing the following test unit error working with Rails that I can''t fathom. I have a products.yml file which holds the following test fixture for the products table: dell_pc: id: 1 title: Dell PC description: Dell PC image_url: http://.../pc_image.jpg price: 15000.00 date_available: 2005-12-31 06:53:00 I also have the following product_test.rb file to
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 Apr 21
2
NoMethodError with test_read_with_hash
While running the product_test.rb test fixture in the Agile Web Development book (p. 148), but when I run ruby test/unit/product_test.rb, I get the following error: 1) Error: test_read_with_hash(ProductTest): NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[]
2006 Mar 04
2
unittest, not loading yml data
Here is my products.yml version_control_book: id: 1 title: Pragmatic Version Control description: How to use version control image_url: /images/sk_svn_small.jpg price: 29.95 date_available: 2005-01-26 00:00:00 automation_book: id: 2 title: Pragmatic Project Automation description: How to automate your project
2006 Jun 24
5
Rake vs Ruby for running tests (error discrepency)
I''m having (to me) a strange problem with errors when running my tests with rake as opposed to using ruby. If I do rake test:units I get this error for several tests, but not all: 13) Error: test_player_has_game_statistics_for_season(PlayerSeasonTest): ActiveRecord::StatementInvalid: Mysql::Error: Duplicate entry ''22'' for key 1: INSERT INTO positions (`name`, `id`,
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/
2005 Dec 30
1
Problems with Testing (Depot) demo app in Agile Rails book
I''ve encountered a perplexing problem whilst following along the demo app in the "Agile Web Development with Rails" book. Any help would be greatly appreciated. Here is a brief time line of my tale of woe:- 0. Been programming (business apps) and designing/building DBs for two decades - but new to both Ruby and Rails (so I apologise in advance if I''ve made some
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
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
2006 Feb 21
0
DB not being repopulated prior to Unit test execution
I''m working my way through the AWD book and have just started the testing chapter. The first two unit tests run as expected. When I add the test for the ''destroy'' function to product_test.rb, however, I''m getting a failure I don''t understand. The error I''m getting says that in the setup method for test_update, it "couldn''t
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 **
2007 Sep 21
1
Do fixture_scenarios and RSpec peacibly coexist?
Railsters: I just installed fixture_scenarios ... http://fixture-scenarios.googlecode.com/svn/trunk/fixture_scenarios ...into a project with some RSpec specifications. They all went kablooey. I didn''t even create a scenario; the system just started calling its version of fixtures(). The normal tests pass and the RSpec ones unanimously emit: TypeError in ''Context (verbose
2006 Nov 07
4
Unknown column 'id' in 'field list
Hello, I''m trying to write a unit test for model that doesn''t have an ''id'' field. I created the model''s table with the following migration, making sure the primary key was set. class CreateActiveUserMetrics < ActiveRecord::Migration def self.up create_table :active_user_metrics, {:id => false,
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
2006 Apr 11
0
Problem using generate/scaffold and FireRuby
Hi to all, I am trying to use "ruby script/generate scaffold product". I always get the message "uninitialized constant CHARACTER_SET". I have a products table in a Firebird database called depot_development.fdb. Here is my config file : > common: &common > adapter: firebird > host: localhost > username: SYSDBA > password: masterkey >
2006 Mar 09
4
Strange Unit Testing error - newbie question
I''m fairly new to Rails, and I''ve been learning from AGILE WEB DEVELOPMENT WITH RAILS. Everything has been going smoothly until the chapter on Unit Testing, where I''m getting some strange errors. I''m up to page 141 in the Agile book, and attempting to run the test program containing the method test_read_with_hash. The previous tests work properly, but I
2006 Mar 19
2
Unit test confusion
Hey all, I''m following along with AWDWR, specifically the unit testing. On page 148, it shows you how Test::Unit::TestCase will automatically define instance variables based on your fixtures. It doesn''t seem to actually work, though. It seems that both @artists ["beatles"]["name"] and @beatles.name are nil objects in my test, where as
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"