2011-04-12 93 views
1

我已经更新了我的包,并且因为我的验收测试不及格......的Rails 3 - 黄瓜 - Omniauth和问题.... :(

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:设计:: 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) 

如果你有什么想法?谢谢 !!!!!!!!!!!!!!!!!!!!

+0

没有人知道吗? :/ – Arkan 2011-04-13 23:18:32

回答

1

设计1.2删除Devise :: OmniAuth :: TestHelpers,现在你应该使用Omniauth测试助手。安装devise 1.2.0,你会看到正确的错误信息(并停止直接从git仓库使用它)。

+0

感谢您的回复。 我要试试这个! – Arkan 2011-04-27 21:49:47