Rails 3-Cucumber-Omniauth 和问题....:(

发布于 2024-11-01 04:32:38 字数 2858 浏览 4 评论 0原文

我已经更新了我的捆绑包,从那时起,我的验收测试没有通过...

when /^Facebook reply$/ do
  Devise::OmniAuth.short_circuit_authorizers!
  Devise::OmniAuth.stub!(:facebook) do |b|
    b.post('/oauth/access_token') { [200, {}, ACCESS_TOKEN.to_json] }
    b.get('/me?access_token=plataformatec') { [200, {}, FACEBOOK_INFO.to_json] }
  end
  visit '/users/auth/facebook/callback'
end

并且我有以下错误:

Devise is not missing constant TestHelpers! (ArgumentError)
./features/step_definitions/users_connect_steps.rb:20:in `/^Facebook reply$/'
features/users_connect.feature:9:in `And Facebook reply'

第 20 行是:Devise::OmniAuth.short_ Circuit_authorizers!

这是我的捆绑清单

Gems included by the bundle:
  * ZenTest (4.5.0)
  * abstract (1.0.0)
  * actionmailer (3.0.6)
  * actionpack (3.0.6)
  * activemodel (3.0.6)
  * activerecord (3.0.6)
  * activeresource (3.0.6)
  * activesupport (3.0.6)
  * addressable (2.2.5)
  * arel (2.0.9)
  * autotest (4.4.6)
  * bcrypt-ruby (2.1.4)
  * bson (1.3.0)
  * bson_ext (1.3.0)
  * builder (2.1.2)
  * bundler (1.0.10)
  * cancan (1.6.4)
  * capistrano (2.5.21)
  * carrierwave (0.5.3)
  * configuration (1.2.0)
  * cucumber (0.10.2)
  * cucumber-rails (0.4.1)
  * database_cleaner (0.6.6)
  * devise (1.3.0.dev 1f51524)
  * diff-lcs (1.1.2)
  * erubis (2.6.6)
  * factory_girl (1.3.3)
  * factory_girl_rails (1.0.1)
  * faraday (0.6.0)
  * gcoder (0.11.0 655e7d0)
  * gherkin (2.3.5)
  * haml (3.0.24)
  * haml-rails (0.3.4)
  * hashie (1.0.0)
  * heroku (1.20.1)
  * highline (1.6.1)
  * hpricot (0.8.3)
  * i18n (0.5.0)
  * jquery-rails (0.2.7)
  * json (1.5.1)
  * launchy (0.3.7)
  * mail (2.2.15)
  * mime-types (1.16)
  * mini_magick (3.2)
  * mongo (1.3.0)
  * mongoid (2.0.1)
  * multi_json (0.0.5)
  * multipart-post (1.1.0)
  * net-scp (1.0.4)
  * net-sftp (2.0.5)
  * net-ssh (2.1.4)
  * net-ssh-gateway (1.0.1)
  * nokogiri (1.4.4)
  * oa-core (0.2.1)
  * oa-oauth (0.2.1)
  * oa-openid (0.2.1)
  * oauth (0.4.4)
  * oauth2 (0.2.0)
  * orm_adapter (0.0.4)
  * polyglot (0.3.1)
  * rack (1.2.2)
  * rack-mount (0.6.14)
  * rack-openid (1.2.0)
  * rack-test (0.5.7)
  * rails (3.0.6)
  * rails3-generators (0.17.4)
  * railties (3.0.6)
  * rake (0.8.7)
  * rest-client (1.6.1)
  * rspec (2.5.0)
  * rspec-core (2.5.1)
  * rspec-expectations (2.5.0)
  * rspec-mocks (2.5.0)
  * rspec-rails (2.5.0)
  * ruby-openid (2.1.8)
  * ruby-openid-apps-discovery (1.2.0)
  * ruby_parser (2.0.6)
  * sexp_processor (3.0.5)
  * simple_form (1.3.1)
  * subexec (0.0.4)
  * switch_user (0.6.0 008d360)
  * term-ansicolor (1.0.5)
  * thor (0.14.6)
  * treetop (1.4.9)
  * tzinfo (0.3.26)
  * warden (1.0.3)
  * webrat (0.7.3)
  * will_paginate (3.0.pre2)
  * workflow (0.8.0)
  * workflow_on_mongoid (0.8.0.1)
  * yajl-ruby (0.8.2)

如果您有任何想法吗?谢谢 !!!!!!!!!!!!!!!!!!!!

I have updated my bundle, and since, my acceptance tests do not pass ...

when /^Facebook reply$/ do
  Devise::OmniAuth.short_circuit_authorizers!
  Devise::OmniAuth.stub!(:facebook) do |b|
    b.post('/oauth/access_token') { [200, {}, ACCESS_TOKEN.to_json] }
    b.get('/me?access_token=plataformatec') { [200, {}, FACEBOOK_INFO.to_json] }
  end
  visit '/users/auth/facebook/callback'
end

And i have the following error :

Devise is not missing constant TestHelpers! (ArgumentError)
./features/step_definitions/users_connect_steps.rb:20:in `/^Facebook reply$/'
features/users_connect.feature:9:in `And Facebook reply'

The line 20 is: Devise::OmniAuth.short_circuit_authorizers!

And this is my bundle list

Gems included by the bundle:
  * ZenTest (4.5.0)
  * abstract (1.0.0)
  * actionmailer (3.0.6)
  * actionpack (3.0.6)
  * activemodel (3.0.6)
  * activerecord (3.0.6)
  * activeresource (3.0.6)
  * activesupport (3.0.6)
  * addressable (2.2.5)
  * arel (2.0.9)
  * autotest (4.4.6)
  * bcrypt-ruby (2.1.4)
  * bson (1.3.0)
  * bson_ext (1.3.0)
  * builder (2.1.2)
  * bundler (1.0.10)
  * cancan (1.6.4)
  * capistrano (2.5.21)
  * carrierwave (0.5.3)
  * configuration (1.2.0)
  * cucumber (0.10.2)
  * cucumber-rails (0.4.1)
  * database_cleaner (0.6.6)
  * devise (1.3.0.dev 1f51524)
  * diff-lcs (1.1.2)
  * erubis (2.6.6)
  * factory_girl (1.3.3)
  * factory_girl_rails (1.0.1)
  * faraday (0.6.0)
  * gcoder (0.11.0 655e7d0)
  * gherkin (2.3.5)
  * haml (3.0.24)
  * haml-rails (0.3.4)
  * hashie (1.0.0)
  * heroku (1.20.1)
  * highline (1.6.1)
  * hpricot (0.8.3)
  * i18n (0.5.0)
  * jquery-rails (0.2.7)
  * json (1.5.1)
  * launchy (0.3.7)
  * mail (2.2.15)
  * mime-types (1.16)
  * mini_magick (3.2)
  * mongo (1.3.0)
  * mongoid (2.0.1)
  * multi_json (0.0.5)
  * multipart-post (1.1.0)
  * net-scp (1.0.4)
  * net-sftp (2.0.5)
  * net-ssh (2.1.4)
  * net-ssh-gateway (1.0.1)
  * nokogiri (1.4.4)
  * oa-core (0.2.1)
  * oa-oauth (0.2.1)
  * oa-openid (0.2.1)
  * oauth (0.4.4)
  * oauth2 (0.2.0)
  * orm_adapter (0.0.4)
  * polyglot (0.3.1)
  * rack (1.2.2)
  * rack-mount (0.6.14)
  * rack-openid (1.2.0)
  * rack-test (0.5.7)
  * rails (3.0.6)
  * rails3-generators (0.17.4)
  * railties (3.0.6)
  * rake (0.8.7)
  * rest-client (1.6.1)
  * rspec (2.5.0)
  * rspec-core (2.5.1)
  * rspec-expectations (2.5.0)
  * rspec-mocks (2.5.0)
  * rspec-rails (2.5.0)
  * ruby-openid (2.1.8)
  * ruby-openid-apps-discovery (1.2.0)
  * ruby_parser (2.0.6)
  * sexp_processor (3.0.5)
  * simple_form (1.3.1)
  * subexec (0.0.4)
  * switch_user (0.6.0 008d360)
  * term-ansicolor (1.0.5)
  * thor (0.14.6)
  * treetop (1.4.9)
  * tzinfo (0.3.26)
  * warden (1.0.3)
  * webrat (0.7.3)
  * will_paginate (3.0.pre2)
  * workflow (0.8.0)
  * workflow_on_mongoid (0.8.0.1)
  * yajl-ruby (0.8.2)

If you have any idea ? Thanks !!!!!!!!!!!!!!!!!!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖乖哒 2024-11-08 04:32:39

Devise 1.2 删除了 Devise::OmniAuth::TestHelpers,现在您应该使用 Omniauth 测试助手。安装 devise 1.2.0,您将看到正确的错误消息(并直接从 git 存储库停止使用它)。

Devise 1.2 removed Devise::OmniAuth::TestHelpers, now you should use Omniauth test helpers. Install devise 1.2.0 and you will see the proper error messages (and stop using it straight from the git repository).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文