0
我有延伸ApplicationRecord和ApplicationRecord延伸的ActiveResource的ActiveResource :: Base的模型尋求表同時測試
class ApplicationRecord < ActiveResource::Base
end
class Airport < ApplicationRecord
end
當我運行測試,它給我的錯誤就像一個機場模型:: Base的:
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "airports" does not exist LINE 1: DELETE FROM "airports" ^: DELETE FROM "airports"
它爲什麼要尋找機場表?所有模型都從ActiveResource :: Base擴展而來,我沒有任何模型表。所以我不能運行測試。我如何禁用在測試模式下查找表格? 在開發模式下,沒有像這樣的問題。