在我的黄瓜步骤定义文件中,我有以下内容:
Given(/^I am on the home page$/) do
visit root_path
end
但是当我运行规范时,我得到以下错误
Given I am on the home page # features/step_definitions/select_country_webpublisher_and_targettype_steps.rb:1
Mysql2::Error: Table 'geomapping_tool_test.countrycode' doesn't exist: SHOW FULL FIELDS FROM `CountryCode` (ActiveRecord::StatementInvalid)
./app/controllers/geo_mapping_controller.rb:3:in `index'
./features/step_definitions/select_country_webpublisher_and_targettype_steps.rb:2:in `/^I am on the home page$/'
features/select_country_webpublisher_and_targettype.feature:7:in `Given I am on the home page'
我的 Rails 应用程序中有一个名为 CountryCode 的模型,它连接到具有同名表的旧数据库,所以在我拥有的模型中self.table_name = 'CountryCode'
,这会影响测试吗?
请帮忙谢谢