0

我有一个 Cucumber 场景,它以下列方式失败:

  Scenario: I can create a blog post                  # features/blog/create_blog_post.feature:6
    Given I am the super admin                        # features/step_definitions/post_steps.rb:1
      PG::Error: ERROR:  syntax error at or near "."
      LINE 1: SELECT  "user".* FROM "user"  ORDER BY user.updated_at desc ...
                                                         ^
      : SELECT  "user".* FROM "user"  ORDER BY user.updated_at desc LIMIT 1 (ActiveRecord::StatementInvalid)
      (eval):8:in `instance_eval'
      (eval):8:in `dashboard'
      ./features/support/world_extensions.rb:51:in `sign_in_with'
      ./features/step_definitions/post_steps.rb:2:in `/^I am the super admin$/'
      features/blog/create_blog_post.feature:7:in `Given I am the super admin'
    When I create a blog post                         # features/step_definitions/post_steps.rb:5
    Then that blog post should show up on the website # features/step_definitions/post_steps.rb:14

显然,这里的问题user是没有被正确引用(实际上它被称为user,而不是users)。知道如何解决这个问题吗?

4

1 回答 1

1

看来您的测试数据库不是最新的。一开始试试rake db:test:prepare

于 2013-05-03T11:54:18.033 回答