Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "authlogic/test_case"
- World(Authlogic::TestCase)
- Before do
- @cookies = ActionDispatch::Cookies::CookieJar.new(Rails.application.config.secret_token)
- Authlogic::TestCase::MockCookieJar.stub(:new).and_return{ @cookies }
- ActionDispatch::Request.any_instance.stub(:cookies).and_return{ @cookies }
- ActionDispatch::Request.any_instance.stub(:cookie_jar).and_return{ @cookies }
- activate_authlogic
- end
- def current_user
- UserSession.find.try(:record)
- end
Add Comment
Please, Sign In to add comment