search for: producttest

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

Did you mean: product_test
2005 Dec 31
2
Test Unit Problem
...: 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 test the fixture above: require File.dirname(__FILE__) + ''/../test_helper'' class ProductTest < Test::Unit::TestCase fixtures :products def setup @product = Product.find(1) end def test_fixtures assert_kind_of Product, @product assert_equal 1, @product.id assert_equal "Dell PC", @product.title assert_equal "Dell PC", @product.description asse...
2006 Jul 11
4
assert fails with <false> is not true
Hi, I have a simple model and written a testcase. class Product < ActiveRecord::Base validates_presense_of :name end ------------- class ProductTest < Test::Unit::TestCase fixtures :products def test_invalid product = Product.new assert !product.valid? end end ------------- The testcase fails with a message, <false> is not true. What is wrong with the testcase? I can see it ruby console that "product.valid?" r...
2006 Jul 06
0
problema con i test automatizzati
...quot;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__) + ''/../test_helper'' class ProductTest &lt; Test::Unit::TestCase   fixtures :products     def setup         @product = Product.find(1)     end   # Replace this with your real tests.   def test_create     assert_kind_of Product, @product         assert_equal 1, @product.id         assert_equal "Pragmatic Version Control...
2006 Mar 04
2
unittest, not loading yml data
...image_url: /images/sk_auto_small.jpg price: 29.95 date_available: 2004-07-01 00:00:00 and I was trying to use @products and @version_control_book in my product_test.rb script here is my test_product.rb require File.dirname(__FILE__) + ''/../test_helper'' class ProductTest < Test::Unit::TestCase fixtures :products def setup @product = Product.find(1) end def test_load_yml assert_equal nil, @products assert_equal nil, @version_control_book assert_equal nil, @automation_book end end And here is what I am getting...
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.[] test/unit/product_test.rb:39:in `test_read_with_hash'' 4 tests, 15 assertions, 0 failures, 1 errors Below is my code for...
2006 Apr 13
1
Setting up Testing model, getting an error
I setup a testing model in my Depot web app from the Agile Web Development with Rails book and came up with the following errors: Loaded suite test/unit/product_test Started EE Finished in 0.050279 seconds. 1) Error: test_create(ProductTest): Errno::ENOENT: No such file or directory - /Users/Mike/Sites/depot/config/../test/fixtures/categories /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/fixtures.rb:327:in `open'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/fixtur...
2013 Mar 14
3
Error: did not find expected key while parsing a block mapping
I run test: test:units lass ProductTest < ActiveSupport::TestCase test "product attributes not be empty" do product = Product.new assert product.invalid? assert product.errors[:title].any? assert product.errors[:description].any? assert product.errors[:price].any? assert product.errors[:imag...
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 ============================================================ and heres the product_test.rb code: ============================================================ require File.d...
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
2010 Dec 06
10
testing chapter: agile web dev withrails
I am working my way through Agile web development with rails and I''m in the testing chapter. when I run the following test(or any other test) I''m new and not sure where to start looking. require ''test_helper'' class ProductTest < ActiveSupport::TestCase # Replace this with your real tests. test "the truth" do assert true end end I always get ActiveRecord::StatementInvalid: SQLite3::SQLException: table users has no column named image_url: INSERT INTO "users" ("created_at", &quo...
2011 Mar 22
2
Problems with SQLite3
...ActiveRecord::Migration # ... def self.down drop_table :products end end Example 2: > rake test Loaded suite /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader Started E Finished in 0.046598 seconds. 1) Error: test_product_attributes_must_not_be_empty(ProductTest): SystemStackError: stack level too deep /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rails_sql_views-0.8.0/lib/rails_sql_views/connection_adapters/abstract_adapter.rb:23 1 tests, 0 assertions, 0 failures, 1 errors, 0 skips It doesn''t matter, what is in the test. Any test will fail, ev...