我已經在我的網站上設置Facebook登錄後this tutorial和我使用黃瓜和水豚。我嘗試過其他SO帖子like this,這些帖子解釋瞭如何設置虛假登錄帳戶。如果我直接用這個,我得到:測試Facebook的登錄與導航黃瓜
When I follow "sign_in" # features/step_definitions/web_steps.rb:56
No route matches [GET] "/oauth/authorize" (ActionController::RoutingError)
./features/step_definitions/web_steps.rb:57:in `/^(?:|I)follow "([^"]*)"$/'
features/facebook_signin.feature:9:in `When I follow "sign_in"'
如果我添加get "/oauth/authorize"
我的路,我得到:
When I follow "sign_in" # features/step_definitions/web_steps.rb:56
uninitialized constant OauthController (ActionController::RoutingError)
./features/step_definitions/web_steps.rb:57:in `/^(?:|I)follow "([^"]*)"$/'
features/facebook_signin.feature:9:in `When I follow "sign_in"'
我不知道是怎麼回事,爲什麼它是抱怨。如果我從gem 'omniauth-facebook', '1.4.0'
改變我的Gemfile只是gem 'omniauth-facebook'
我得到上面幾乎同樣的錯誤,除了代替:
/oauth/authorize
,我得到/dialog/oauth
和替代uninitialized constant OauthController
,我得到uninitialized constant DialogController
有沒有人最近成功地建立了黃瓜測試用Facebook登錄?
當我在localhost:3000,然後導航到本地主機:3000 /認證/ Facebook的一切工作和我使用的是sessionsController,所以我不明白爲什麼在測試中,它試圖利用這些oauthControllers或DialogueControllers。
我已經upvoted這個,因爲它解決了我的問題。但是,我注意到我正在使用實時API執行測試,以便我可以用vcr gem記錄它。 – Obromios