Problem Testing RoR

I read / learn "agile development." Now I am in chapter 14 (testing) /

when I tried to run "@ruby -I test test / unit / product_test.rb" I have an error that

1) Error:
test_invalid_with_empty_attributes(ProductTest):
ActiveRecord::StatementInvalid: PGError: ERROR:  relation "carts" does not exist
LINE 1: DELETE FROM "carts"
                    ^
: DELETE FROM "carts"

but the cart model does not belong to "ActiveRecord"

what am I doing wrong?

(sorry for the mistakes, I'm bad in English)

+3
source share
1 answer

, "" . Rails 'test', database.yml. , , . rake db:test:load rake db:test:prepare, .

, rake --tasks db:test RubyOnRails.org .

+5

Source: https://habr.com/ru/post/1733680/


All Articles