Pergunta

Testing a Ruby on Rails application, I have working tests (also asa logged in user), however as soon as I put the ":js=>true" option behind a test

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

a get the web page with an internal error back

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

How can I get this to work? How can I determine the error more closely?

Foi útil?

Solução

By now it works for me, I think because of this dirty snippet

    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 comes from the question SO: authlogic-with-capybara-cucumber-selenium-driver-not-working

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top