我知道理想的做法是填写登录表单并遵循该流程。问题是我没有使用设计进行登录。我使用Facebook和fb_graph gem进行身份验证后,在我的应用程序中登录了用户。测试设计用黄瓜登录
因此,设计的sign_in视图只有链接“连接Facebook”,但我能够看到该路线,并且我假设在用户登录该网址时会尝试登录该用户。
我试图做一个邮寄到sign_in(这观点是空的)直接用黄瓜,和即使响应是确定的,用户没有登录。
Given /^I am a logged in user$/ do
@user = Factory(:user)
res = post("https://stackoverflow.com/users/sign_in", :email => @user.email, :password => "password")
p res
end
如何测试呢?
感谢,
UPDATE:
的情况是这样的:
Scenario: Going to the index page
Given I am a logged in user
And there is a subject created
And there is 1 person for that subject
When I go to that subject persons index page
And show me the page
Then I should see "Back to Subjects list"