Ruby on rails 黄瓜规格中的访问根路径出错

Ruby on rails 黄瓜规格中的访问根路径出错,ruby-on-rails,ruby-on-rails-3,cucumber,bdd,Ruby On Rails,Ruby On Rails 3,Cucumber,Bdd,在cucumber步骤定义文件中,我有以下内容: 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: Ta

在cucumber步骤定义文件中,我有以下内容:

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\u name='CountryCode'
,这会影响测试吗

请帮忙 谢谢

您是否“准备”了测试数据库

rake数据库:测试:准备