0

次のように失敗するキュウリのシナリオがあります。

  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 に答える