如何使用Authlogic_RPX和Steak测试用户功能?

我正在尝试测试用户应该登录的Rails 3应用程序的功能。 我使用authlogic_rpx通过Facebook和Twitter验证用户,但我不想测试该过程。我正在寻找的是以编程方式创建用户会话。 我试着将它添加到我的acceptance_helper.rb文件中:
require "authlogic/test_case"

Spec::Runner.configure do |config|
  config.include Authlogic::TestCase, :type => :acceptance
  config.before(:each, :type => :acceptance) do
    activate_authlogic
  end
end
并测试如下:
scenario "Sign in" do
  user = Factory(:user)
  UserSession.create(user)

  visit root_path

  save_and_open_page
end
但是@current_user变量看起来是空的。 (我到处用它来查看用户是否已登录。) 任何的想法? 凯文     
已邀请:

要回复问题请先登录注册