黄瓜找不到表;但它就在那里。到底是怎么回事?

发布于 2024-09-06 04:45:23 字数 2120 浏览 3 评论 0原文

我正在处理黄瓜,但遇到了困难。当我运行“cucumber features”时,我遇到错误,cucumber 无法找到我的请求表。我犯了什么明显的错误?

先感谢您!

Bash:

justin-zollarss-mac-pro:conversion justinz$ cucumber features
Using the default profile...
/Users/justinz/.gem/ruby/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
F--

(::) failed steps (::)

Could not find table 'requests' (ActiveRecord::StatementInvalid)
./features/article_steps.rb:3
./features/article_steps.rb:2:in `each'
./features/article_steps.rb:2:in `/^I have requests named (.+)$/'
features/manage_articles.feature:7:in `Given I have requests named Foo, Bar'

Failing Scenarios:
cucumber features/manage_articles.feature:6 # Scenario: Conversion

1 scenario (1 failed)
3 steps (1 failed, 2 skipped)
0m0.154s
justin-zollarss-mac-pro:conversion justinz$ 

Manage_articles.feature:

Feature: Manage Articles
    In order to make sales
    As a customer
    I want to make conversions

Scenario: Conversion
    Given I have requests named Foo, Bar
    When I go to the list of customers
    Then I should see a new "customer"

Article_steps.rb:

Given /^I have requests named (.+)$/ do |firsts|
   firsts.split(', ').each do |first|
      Request.create!(:first => first)
  pending # express the regexp above with the code you wish you had
end
end


Then /^I should see a new "([^"]*)"$/ do |arg1|
  pending # express the regexp above with the code you wish you had
end

数据库架构:

ActiveRecord::Schema.define(:version => 20100528011731) do

  create_table "requests", :force => true do |t|
    t.string   "institution"
    t.string   "website"
    t.string   "type"
    t.string   "users"
    t.string   "first"
    t.string   "last"
    t.string   "jobtitle"
    t.string   "phone"
    t.string   "email"
    t.datetime "created_at"
    t.datetime "updated_at"
  end end

I'm working with cucumber and I'm running into difficulties. When I run "cucumber features", I am met with errors, cucumber is unable to find my requests table. What obvious mistake am I making?

Thank you in advance!

Bash:

justin-zollarss-mac-pro:conversion justinz$ cucumber features
Using the default profile...
/Users/justinz/.gem/ruby/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
F--

(::) failed steps (::)

Could not find table 'requests' (ActiveRecord::StatementInvalid)
./features/article_steps.rb:3
./features/article_steps.rb:2:in `each'
./features/article_steps.rb:2:in `/^I have requests named (.+)$/'
features/manage_articles.feature:7:in `Given I have requests named Foo, Bar'

Failing Scenarios:
cucumber features/manage_articles.feature:6 # Scenario: Conversion

1 scenario (1 failed)
3 steps (1 failed, 2 skipped)
0m0.154s
justin-zollarss-mac-pro:conversion justinz$ 

Manage_articles.feature:

Feature: Manage Articles
    In order to make sales
    As a customer
    I want to make conversions

Scenario: Conversion
    Given I have requests named Foo, Bar
    When I go to the list of customers
    Then I should see a new "customer"

Article_steps.rb:

Given /^I have requests named (.+)$/ do |firsts|
   firsts.split(', ').each do |first|
      Request.create!(:first => first)
  pending # express the regexp above with the code you wish you had
end
end


Then /^I should see a new "([^"]*)"$/ do |arg1|
  pending # express the regexp above with the code you wish you had
end

DB schema:

ActiveRecord::Schema.define(:version => 20100528011731) do

  create_table "requests", :force => true do |t|
    t.string   "institution"
    t.string   "website"
    t.string   "type"
    t.string   "users"
    t.string   "first"
    t.string   "last"
    t.string   "jobtitle"
    t.string   "phone"
    t.string   "email"
    t.datetime "created_at"
    t.datetime "updated_at"
  end end

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红焚 2024-09-13 04:45:23

您是否在测试/黄瓜环境中运行了迁移?

Have you run your migrations in the test/cucumber environment?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文