14.3 Functional Testing of Controllers 14.1 Tests Baked Right In
</1 tests, 1 assertions, 0 failures, 0 errors/> expected but was <"require 'test_helper'">. Traceback: /home/rubys/git/awdwr/edition3/work-192-23/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb:307:in `assert_select' /home/rubys/git/awdwr/edition3/checkdepot.rb:224:in `block in <class:DepotTest>'
cat test/unit/product_test.rb
require 'test_helper'
class ProductTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
ruby -Itest test/unit/product_test.rb
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
Loaded suite test/unit/product_test
Started
E
Finished in 0.064710 seconds.
1) Error:
test_the_truth(ProductTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: products: DELETE FROM "products" WHERE 1=1
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `rescue in log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:204:in `log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `block in execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:418:in `catch_schema_changes'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:265:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:176:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:270:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:182:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in `delete'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `delete_with_query_dirty'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:549:in `delete_existing_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (4 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (3 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:510:in `block (2 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:501:in `block in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1482:in `silence'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:500:in `create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:929:in `setup_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `block in run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:23:in `run'
1 tests, 0 assertions, 0 failures, 1 errors, 0 skips
Test run options: --seed 18124
rake db:test:prepare
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
/home/rubys/git/awdwr/edition3/work-192-23/depot/Rakefile:8:in `<top (required)>'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
ruby -Itest test/unit/product_test.rb
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
Loaded suite test/unit/product_test
Started
E
Finished in 0.115393 seconds.
1) Error:
test_the_truth(ProductTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: products: DELETE FROM "products" WHERE 1=1
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `rescue in log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:204:in `log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `block in execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:418:in `catch_schema_changes'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:265:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:176:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:270:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:182:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in `delete'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `delete_with_query_dirty'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:549:in `delete_existing_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (4 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (3 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:510:in `block (2 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:501:in `block in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1482:in `silence'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:500:in `create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:929:in `setup_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `block in run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:23:in `run'
1 tests, 0 assertions, 0 failures, 1 errors, 0 skips
Test run options: --seed 37134
rake test:units
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
/home/rubys/git/awdwr/edition3/work-192-23/depot/Rakefile:8:in `<top (required)>'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
edit test/unit/product_test.rb
require 'test_helper'
class ProductTest < ActiveSupport::TestCase
fixtures :products
# Replace this with your real tests.
test "the truth" do
assert true
end
test "invalid with empty attributes" do
product = Product.new
assert !product.valid?
assert product.errors.invalid?(:title)
assert product.errors.invalid?(:description)
assert product.errors.invalid?(:price)
assert product.errors.invalid?(:image_url)
end
test "positive price" do
product = Product.new(:title => "My Book Title",
:description => "yyy",
:image_url => "zzz.jpg")
product.price = -1
assert !product.valid?
assert_equal "should be at least 0.01", product.errors.on(:price)
product.price = 0
assert !product.valid?
assert_equal "should be at least 0.01", product.errors.on(:price)
product.price = 1
assert product.valid?
end
test "image url" do
ok = %w{ fred.gif fred.jpg fred.png FRED.JPG FRED.Jpg
http://a.b.c/x/y/z/fred.gif }
bad = %w{ fred.doc fred.gif/more fred.gif.more }
ok.each do |name|
product = Product.new(:title => "My Book Title",
:description => "yyy",
:price => 1,
:image_url => name)
assert product.valid?, product.errors.full_messages.join
end
bad.each do |name|
product = Product.new(:title => "My Book Title",
:description => "yyy",
:price => 1,
:image_url => name)
assert !product.valid?, "saving #{name}"
end
end
test "unique title" do
product = Product.new(:title => products(:ruby_book).title,
:description => "yyy",
:price => 1,
:image_url => "fred.gif")
assert !product.save
assert_equal "has already been taken", product.errors.on(:title)
end
test "unique title1" do
product = Product.new(:title => products(:ruby_book).title,
:description => "yyy",
:price => 1,
:image_url => "fred.gif")
assert !product.save
assert_equal I18n.translate('activerecord.errors.messages.taken'),
product.errors.on(:title)
end
end
edit test/fixtures/products.yml
ruby_book:
title: Programming Ruby
description: Dummy description
price: 1234
image_url: ruby.png
rails_book:
title: Agile Web Development with Rails
description: Dummy description
price: 2345
image_url: rails.png
rake test:units
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
/home/rubys/git/awdwr/edition3/work-192-23/depot/Rakefile:8:in `<top (required)>'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
edit test/unit/cart_test.rb
require 'test_helper'
class CartTest < ActiveSupport::TestCase
fixtures :products
test "add unique products" do
cart = Cart.new
rails_book = products(:rails_book)
ruby_book = products(:ruby_book)
cart.add_product rails_book
cart.add_product ruby_book
assert_equal 2, cart.items.size
assert_equal rails_book.price + ruby_book.price, cart.total_price
end
test "add_duplicate_product" do
cart = Cart.new
rails_book = products(:rails_book)
cart.add_product rails_book
cart.add_product rails_book
assert_equal 2*rails_book.price, cart.total_price
assert_equal 1, cart.items.size
assert_equal 2, cart.items[0].quantity
end
end
ruby -I test test/unit/cart_test.rb
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
Loaded suite test/unit/cart_test
Started
EE
Finished in 0.067569 seconds.
1) Error:
test_add_duplicate_product(CartTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: products: DELETE FROM "products" WHERE 1=1
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `rescue in log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:204:in `log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `block in execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:418:in `catch_schema_changes'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:265:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:176:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:270:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:182:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in `delete'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `delete_with_query_dirty'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:549:in `delete_existing_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (4 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (3 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:510:in `block (2 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:501:in `block in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1482:in `silence'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:500:in `create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:929:in `setup_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `block in run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:23:in `run'
2) Error:
test_add_unique_products(CartTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: products: DELETE FROM "products" WHERE 1=1
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `rescue in log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:204:in `log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `block in execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:418:in `catch_schema_changes'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:265:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:176:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:270:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:182:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in `delete'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `delete_with_query_dirty'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:549:in `delete_existing_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (4 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (3 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:510:in `block (2 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:501:in `block in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1482:in `silence'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:500:in `create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:929:in `setup_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `block in run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:23:in `run'
2 tests, 0 assertions, 0 failures, 2 errors, 0 skips
Test run options: --seed 20386
edit test/unit/cart_test1.rb
require 'test_helper'
class CartTest < ActiveSupport::TestCase
fixtures :products
def setup
@cart = Cart.new
@rails = products(:rails_book)
@ruby = products(:ruby_book)
end
test "add unique products" do
@cart.add_product @rails
@cart.add_product @ruby
assert_equal 2, @cart.items.size
assert_equal @rails.price + @ruby.price, @cart.total_price
end
test "add duplicate product" do
@cart.add_product @rails
@cart.add_product @rails
assert_equal 2*@rails.price, @cart.total_price
assert_equal 1, @cart.items.size
assert_equal 2, @cart.items[0].quantity
end
end
ruby -I test test/unit/cart_test1.rb
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
Loaded suite test/unit/cart_test1
Started
EE
Finished in 0.066893 seconds.
1) Error:
test_add_duplicate_product(CartTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: products: DELETE FROM "products" WHERE 1=1
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `rescue in log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:204:in `log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `block in execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:418:in `catch_schema_changes'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:265:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:176:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:270:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:182:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in `delete'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `delete_with_query_dirty'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:549:in `delete_existing_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (4 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (3 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:510:in `block (2 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:501:in `block in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1482:in `silence'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:500:in `create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:929:in `setup_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `block in run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:23:in `run'
2) Error:
test_add_unique_products(CartTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: products: DELETE FROM "products" WHERE 1=1
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `rescue in log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:204:in `log'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `block in execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:418:in `catch_schema_changes'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:265:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:176:in `update_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:270:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:182:in `delete_sql'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in `delete'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `delete_with_query_dirty'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:549:in `delete_existing_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (4 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:511:in `block (3 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:510:in `block (2 levels) in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:501:in `block in create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1482:in `silence'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:500:in `create_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/fixtures.rb:929:in `setup_fixtures'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `block in run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `each'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:23:in `run'
2 tests, 0 assertions, 0 failures, 2 errors, 0 skips
Test run options: --seed 25096
14.3 Functional Testing of Controllers 14.1 Tests Baked Right In