Capybara server can't access data created in a spec

不打扰是莪最后的温柔 提交于 2019-12-12 00:58:30

问题


I am running Sinatra, Capybara and RSpec. I am testing javascript interactions with webkit headless browser. I am using factory girl to create data that I need to be present for my test. I then use capybara to perform interactions with my application. During these interactions the data that I created at the start of the test is no longer available. It's created with no issue however when debugging in the controller the database is empty. Why is my database empty in the controller but not in the spec that interacts with the contorller?


回答1:


Try to read this article (the 3rd point). I think the problem is connected with DB transactions.

You can search a lot of additional info by words rails rspec shared connection



来源:https://stackoverflow.com/questions/18905748/capybara-server-cant-access-data-created-in-a-spec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!