运行 Cucumber 时不会创建数据库记录
我正在使用黄瓜、水豚和工厂女孩开发一个 Rails 项目,最近从 Rails 3.0.3 更新到 Rails 3.0.5,删除了我的 Gemfile.lock,运行 bundle install
命令,看来 cucumber 或 cucumber-rails 已更新,因为我必须再次运行 rails g cucumber:install --capybara --rspec
才出现错误。
问题是,当我运行 cucumber 时,我的所有功能都会失败,因为找不到任何记录,甚至没有找到我在功能文件的“后台”部分中创建的记录(步骤通过)。
我尝试使用相同的 gem 版本组合创建一个新项目,一切正常,但在我当前的项目中却没有。可能发生什么情况?
我的宝石版本是:
Using capybara (0.4.1) from https://github.com/jnicklas/capybara.git (at 0.4.1)
Using cucumber (0.10.2)
Using cucumber-rails (0.4.0)
Using database_cleaner (0.6.6)
Using factory_girl (1.3.3)
Using factory_girl_rails (1.0.1)
Using rails (3.0.5)
Using rspec-core (2.5.1)
Using rspec-expectations (2.5.0)
Using rspec-mocks (2.5.0)
Using rspec (2.5.0)
Using rspec-rails (2.5.0)
I'm working on a rails project using, cucumber, capybara and factory girl, and recently updated from rails 3.0.3 to rails 3.0.5, deleted my Gemfile.lock, run the bundle install
command, and it appears that cucumber or cucumber-rails got updated, because I had to run rails g cucumber:install --capybara --rspec
again for and error that appeared.
The thing is that know when I run cucumber all my features fails because doesn't find any records, not even the records I created (steps passes) in the Background section of the feature file.
I tried the same gem version combination creating a new project and everything worked, but in my current project don't. What could be happening?
My gem versions are:
Using capybara (0.4.1) from https://github.com/jnicklas/capybara.git (at 0.4.1)
Using cucumber (0.10.2)
Using cucumber-rails (0.4.0)
Using database_cleaner (0.6.6)
Using factory_girl (1.3.3)
Using factory_girl_rails (1.0.1)
Using rails (3.0.5)
Using rspec-core (2.5.1)
Using rspec-expectations (2.5.0)
Using rspec-mocks (2.5.0)
Using rspec (2.5.0)
Using rspec-rails (2.5.0)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 gem 版本的问题,我回到 cucumber-rails (0.3.2),一切又恢复正常了
It was a problem with the gem versions, I came back to cucumber-rails (0.3.2) and everything worked again