我有一个 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
)。知道如何解决这个问题吗?