试图得到一个非常简单的场景用黄瓜和设计路过的时候重定向到example.com - 在用户签名...(EPIC FAIL)尝试与水豚,黄瓜,RSpec的登录,并制定
我有像这样的步骤:
user = create(user_sym)
user.confirm!
visit new_user_session_path
fill_in 'Email',:with => user.email
fill_in 'Password',:with => attributes_for(user_sym)[:password]
click_button 'Sign in'
page.should have_content('Sign out')
日志告诉我一切都很好(确认电子邮件发送,UPDATE插入正确的确认标志),然后我看到了重定向到
www.example.com
很多职位这里nd其他地方提到这一点,并使用login_user:callback => false使它工作,但我想使用“访问”。
什么可以导致此。实际的错误是失败的测试,即注销文本没有出现。正在呈现的是Rails主页,即
expected there to be text "Sign out" in "Browse the documentation Rails Guides Rails API Ruby core Ruby standard library Welcome aboard
我不知道哪部分堆栈正在抛出(因为我是新的!)。据推测,水豚重新定向?我已经看到人们得到这个工作,并且在我的Dev堆栈中,它显然会按照您的预期重定向到用户索引页面。
任何光赞赏。
你从删除'index.html'的'公共目录并在你的'routes.rb'文件中配置'root'? – muttonlamb