我正在学习 hartl rails 教程
我在第 8.3 节的末尾,应用程序运行正常,但出现 rspec 错误
1) User pages signup with valid information after saving the user
Failure/Error: it { should have_link('Sign out') }
expected link "Sign out" to return something
# ./spec/requests/user_pages_spec.rb:48:in `block (5 levels) in <top (required)>'
user_pages_spec.rb 中涉及的部分是
it "should create a user" do
expect { click_button submit }.to change(User, :count).by(1)
end
describe "after saving the user" do
it { should have_link('Sign out') }
end
我对如何解决这个问题有点茫然。还有其他与此类似的帖子,但唉,我无法让他们的解决方案适用于我的情况。谢谢。