0

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

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

4

1 回答 1

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

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

于 2012-11-28T08:33:01.153 回答