Authlogic Webapp在selenium-Javascript测试中不再起作用

时间:2012-11-06 14:49:25

标签: ruby selenium rspec capybara authlogic

测试Ruby on Rails应用程序,我有工作测试(也是登录用户),但是只要我在测试后面加上“:js=>true”选项

it "does", :js => true do
    activate_authlogic 
    visit '/'
end

获取内部错误的网页

 You must activate the Authlogic::Session::Base.controller with a controller object before creating objects

我怎样才能让它发挥作用?如何更仔细地确定错误?

1 个答案:

答案 0 :(得分:0)

到目前为止,它对我有用,我认为是因为这个脏片段

    module Authlogic
        module Session
          module Activation
            module ClassMethods
              def controller
                if !Thread.current[:authlogic_controller]
                  Thread.current[:authlogic_controller] = Authlogic::TestCase::MockController.new
                end
              Thread.current[:authlogic_controller]
            end
          end
        end
      end
     end

女巫来自问题SO: authlogic-with-capybara-cucumber-selenium-driver-not-working