【问题标题】:Authlogic Webapp does not work any more in selenium-Javascript testsAuthlogic Webapp 在 selenium-Javascript 测试中不再起作用
【发布时间】:2012-11-06 14:49:24
【问题描述】:

测试一个 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

我怎样才能让它工作?如何更准确地确定错误?

【问题讨论】:

    标签: ruby selenium rspec capybara authlogic


    【解决方案1】:

    现在它对我有用,我想是因为这个肮脏的 sn-p

        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
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-15
      • 2021-06-26
      • 2019-01-24
      • 2016-10-15
      • 1970-01-01
      相关资源
      最近更新 更多