#68 ✓resolved
iwakura-taro

Functional tests fails after migration to authlogic 2.0.3

Reported by iwakura-taro | March 28th, 2009 @ 06:11 AM


# test/test_helper.rb, following documentation:
require 'authlogic/test_case'
class ActiveSupport::TestCase
  def login_as(user)
    UserSession.create(users(user))
  end
end

# test/functional/admin/categories_controller_test.rb
require 'test_helper'
class Admin::CategoriesControllerTest < ActionController::TestCase
  test 'admin should get new' do
    get :new
    assert_response :success
  end
  def setup
    login_as :admin
  end
end

And functional tests fails when trying to use login_as in setup method:

test_should_get_new(Admin::CategoriesControllerTest): Authlogic::Session::Activation::NotActivatedError: You must activate the Authlogic::Session::Base.controller with a controller object before creating objects

authlogic (2.0.3) lib/authlogic/session/activation.rb:45:in `initialize'
authlogic (2.0.3) lib/authlogic/session/klass.rb:61:in `initialize'
authlogic (2.0.3) lib/authlogic/session/scopes.rb:79:in `initialize'
authlogic (2.0.3) lib/authlogic/session/existence.rb:29:in `new'
authlogic (2.0.3) lib/authlogic/session/existence.rb:29:in `create'
test/test_helper.rb:40:in `login_as'
/test/functional/admin/categories_controller_test.rb:40:in `setup'

Comments and changes to this ticket

  • iwakura-taro

    iwakura-taro March 28th, 2009 @ 06:25 AM

    Other related error:

    test_logged_user_should_get_new(ReviewsControllerTest): NoMethodError: protected method cookies' called for #<ReviewsController:0x3462c328>

    authlogic (2.0.3) lib/authlogic/session/cookies.rb:113:in `save_cookie'
    authlogic (2.0.3) lib/authlogic/session/callbacks.rb:72:in `after_save'
    authlogic (2.0.3) lib/authlogic/session/existence.rb:68:in `save'
    authlogic (2.0.3) lib/authlogic/session/existence.rb:30:in `create'
    test/test_helper.rb:40:in `login_as'
    /test/functional/reviews_controller_test.rb:13:in `test_logged_user_should_get_new'
    
    
  • iwakura-taro

    iwakura-taro March 28th, 2009 @ 07:52 AM

    Second error appearing after adding

    
    setup :activate_authlogic
    

    to test class

  • Ben Johnson

    Ben Johnson March 28th, 2009 @ 01:31 PM

    • State changed from “new” to “resolved”

    Yeah, I changed the entire testing suite to be more natural. Do:

    setup :activate_authlogic
    

    Then in your tests, login like normal:

    UserSession.create(users(:ben))
    
  • iwakura-taro

    iwakura-taro March 28th, 2009 @ 01:44 PM

    Does not helps

    test_should_logout(UserSessionsControllerTest): NoMethodError: protected method cookies' called for #<UserSessionsController:0x36068c28>

    authlogic (2.0.3) lib/authlogic/session/cookies.rb:113:in `save_cookie'
    authlogic (2.0.3) lib/authlogic/session/callbacks.rb:72:in `after_save'
    authlogic (2.0.3) lib/authlogic/session/existence.rb:68:in `save'
    authlogic (2.0.3) lib/authlogic/session/existence.rb:30:in `create'
    test/test_helper.rb:41:in `login_as'
    /test/functional/user_sessions_controller_test.rb:9:in `test_should_logout'
    
    
  • Ben Johnson

    Ben Johnson March 28th, 2009 @ 01:50 PM

    What is login_as? That seems like your own method.

  • Ben Johnson

    Ben Johnson March 28th, 2009 @ 01:56 PM

    Also, can you do me a favor, and update from the repository. I made some cahnges to testing.

  • iwakura-taro

    iwakura-taro March 28th, 2009 @ 01:56 PM

    yes, it is and its body is

    
      def login_as(user)
        UserSession.create(users(user))
      end
    
  • iwakura-taro

    iwakura-taro March 28th, 2009 @ 01:59 PM

    Ok, I'll checkout latest snapshot from github

  • Ben Johnson

    Ben Johnson March 28th, 2009 @ 02:01 PM

    If all is good for you then I'll push out an update.

  • iwakura-taro

    iwakura-taro March 28th, 2009 @ 02:19 PM

    This solved issue. Thanks.

  • pihu

    pihu August 22nd, 2019 @ 03:22 AM

    office it the bundle of office apparatuses to make your working smooth and effective.Get it downloaded in your PC with the quick help enter product key for office visit here for more subtleties.

  • pihu

    pihu August 22nd, 2019 @ 03:23 AM

    Incredible, lightweight, incorporated insurance for PC, Mac and Android, cloud-based Webroot Internet Security Complete with antivirus ensures individual data by hindering the most recent malware, phishing, and digital assaults. Visit Enter webroot key code to introduce webroot antivirus in your pc.

  • pihu

    pihu August 22nd, 2019 @ 03:25 AM

    McAfee Activate! you can get started activation with enter product code/key at Mcafee activation key code and visit for more details.

  • pihu

    pihu August 22nd, 2019 @ 03:25 AM

    Office Setup is available for all platforms with different versions like Enter microsoft product key , Office setup 365, Office setup 2013

  • pihu

    pihu August 22nd, 2019 @ 03:25 AM

    norton help to protect your devices against antiviruses and help to optimize and maintain your information from compitetior Enter Norton setup product key visit this website to install norton antivirus in your pc.

  • pihu

    pihu August 22nd, 2019 @ 03:26 AM

    Download, Install & Activate Ms office 365 for home & Business purpose. Also get full technical help for office setup installation. Visit : Office setup 365 product key for more details.

  • pihu

    pihu August 22nd, 2019 @ 03:26 AM

    Query items Included scrap from the web AVG AntiVirus.AVG AntiVirus is a group of antivirus programming created by AVG Technologies,a backup of Avast. It is accessible for Windows, macOS and Android Enter AVG product key click here for more details.

  • techwibes

    techwibes August 22nd, 2019 @ 03:59 AM

    Mcafee antivirus is broadly utilized antivirus distinguishes and kill PC infection, the mail worms,the trojan programs,and additionally enables your framework to free of infection and other malware is a significant day by day challenge mcafee activate enter code click here for more subtleties.

  • vinay

    vinay August 22nd, 2019 @ 04:20 AM

    Norton is the most solid antivirus and we are giving you the full help to get it introduced in your workstations and PCs norton setup with key visit here for more subtleties.

  • vinay

    vinay August 22nd, 2019 @ 04:20 AM

    office it the heap of office gadgets to make your working smooth and effective.Get it downloaded in your PC with the snappy help Enter office setup product key click here for more information.

  • vinay

    vinay August 22nd, 2019 @ 04:22 AM

    mcafee activate ensure your private company's PCs against infections and different malevolent projects. So as to keep the illicit appropriation of its product, all McAfee items must be enacted utilizing an extraordinary key.visit mcafee activate for more subtleties.

  • vinay

    vinay August 22nd, 2019 @ 04:24 AM

    Norton is the most recommended antivirus software, widely used for its reliability in securing your online experience. It gives complete security to your valuable data and device, and with www.norton.com/setup security advancements, you need not worry about the security of your devices.

  • vinay

    vinay August 22nd, 2019 @ 04:25 AM

    Get to know about installing and setting up office.com/setup. The advanced version of office setup productivity suite opens new doors for you to provide the best business productivity experience across desktops, browsers, and mobile devices.

  • vinay

    vinay August 22nd, 2019 @ 04:26 AM

    Download and Install office.com/setup . The users can get the Microsoft Office Setup from both the online or offline mode. In an online way, the user has to visit on office setup and in offline mode, the user has to purchase the office Setup from the shop.

  • vinay

    vinay August 22nd, 2019 @ 04:26 AM

    norton.com/setup offers a fee-based suite of antivirus products which provide various malware detection method. User can protect their devices by regularly scanning the computer with Norton antivirus. norton setup anti-virus suite uses virus definitions, suspicious behavior, emulation and the sandbox method to detect viruses.

  • chanchal

    chanchal August 28th, 2019 @ 04:46 AM

    office it the bundle of office apparatuses to make your working smooth and effective.Get it downloaded in your PC with the quick help Enter office key code visit here for more subtleties.

  • chanchal

    chanchal August 28th, 2019 @ 04:46 AM

    Incredible, lightweight, incorporated insurance for PC, Mac and Android, cloud-based Webroot Internet Security Complete with antivirus ensures individual data by hindering the most recent malware, phishing, and digital assaults. Visit Enter webroot key code
    to introduce webroot antivirus in your pc.

  • chanchal

    chanchal August 28th, 2019 @ 04:47 AM

    Introduce mcafee antivirus in your PC with high class experts and best tech group. Simply ring us and we are prepared to help you till the last moment of establishment.visit: mcafee.com/activate today.

  • chanchal

    chanchal August 28th, 2019 @ 04:47 AM

    mcafee activate ensure your private company's PCs against infections and different malevolent projects. So as to keep the illicit appropriation of its product, all McAfee items must be enacted utilizing an extraordinary key.visit www.mcafee.com/activate for more subtleties.

  • chanchal

    chanchal August 28th, 2019 @ 04:48 AM

    Norton is the most recommended antivirus software, widely used for its reliability in securing your online experience. It gives complete security to your valuable data and device, and with www.norton.com/setup security advancements, you need not worry about the security of your devices.

  • chanchal

    chanchal August 28th, 2019 @ 04:48 AM

    norton setup offers a fee-based suite of antivirus products which provide various malware detection method. User can protect their devices by regularly scanning the computer with Norton antivirus. norton.com/setup anti-virus suite uses virus definitions, suspicious behavior, emulation and the sandbox method to detect viruses.

  • chanchal

    chanchal August 28th, 2019 @ 04:48 AM

    Download and Install office.com/setup . The users can get the Microsoft Office Setup from both the online or offline mode. In an online way, the user has to visit on office.com/setup and in offline mode, the user has to purchase the office Setup from the shop.

  • chanchal

    chanchal August 28th, 2019 @ 04:49 AM

    mcafee product activation is a antivirus programme. This programme secure your computer with virus so you can install it.To know more please visit our website mcafee.com/activate

  • chanchal

    chanchal August 28th, 2019 @ 04:49 AM

    norton web security is generally utilized antivirus gives the least demanding to utilize and most intutive assurance for your PC and your mobiles .introduce it and disregard viruses,spyware,root-units, hackers.for more subtleties visit: norton.com/setup today.

  • chanchal

    chanchal August 28th, 2019 @ 04:49 AM

    Accomplish more with OneDrive and Office 365 Create cleaned reports, open bits of knowledge, present with lucidity, and work together continuously office.com/setup
    utilizing Office 365.

  • chanchal

    chanchal August 28th, 2019 @ 04:50 AM

    Introduce Mcafee antivirus to shield your PC or PC from infection assaults nd ensure ur data. Mcafee Activate Visit there to initiate mcafee antivirus with enactment code that is mcafee.com/activate

  • chanchal

    chanchal August 28th, 2019 @ 04:51 AM

    Introduce mcafee antivirus in your PC with high class experts and best tech group. Simply ring us and we are prepared to help you till the last moment of establishment - visit here mcafee activate enter code for more details.

  • chanchal

    chanchal August 28th, 2019 @ 04:51 AM

    Install mcafee antivirus in your computer with high class professionals and best tech team. Just ring us and we are ready to assist you till the last minute of installation - install mcafee with activation code

  • chanchal

    chanchal August 28th, 2019 @ 04:51 AM

    Download McAfee Antivirus today to protect your PC against threats. visit here install mcafee to download, install or activate McAfee antivirus.

  • hardeep01

    hardeep01 August 30th, 2019 @ 06:40 AM

    Visit introduce mcafee with initiation code to buy a game plan and mastery to download, introduce mcafee with enactment code present and activate McAfee mcafee product activation on your pc to get consistent protection against cybercrime.

  • hardeep01

    hardeep01 August 30th, 2019 @ 06:41 AM

    McAfee Virtual Technician perceives and handles various thing issues on your PC.In case MVT can't resolve the issue, the data accumulated can be used by enter mcafee activation code your assistance master to handle the issue.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:08 AM

    Get a standout amongst the best Office setup support! We offer MS Office 365 setup and MS Office 2016 setup administrations. What's more, our point is to expel every one of the issues of your pc , workstation and so on you can visit: www.office.com/setup our site for more data.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:09 AM

    Install norton antivirus with the best support team and keep your computer virus free. www.norton.com/setup Download norton antivirus with the best support team and avoid virus attacks

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:09 AM

    Get your Office Setup Installed with the office.com/setup assistance of the best help group. You may introduce the total office 365 bundle with no confounded work.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:09 AM

    norton help to guarantee your devices against antiviruses and offer security to customer and giving identity and contraption confirmation to your related life. visit: norton.com/setup for more details.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:10 AM

    Install mcafee product without any hassle. We provide best installation service. www.mcafee.com/activate Activate mcafee antivirus with the highly professional tech team and get rid of antivirus from computer.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:10 AM

    Activate mcafee antivirus with the mcafee.com/activate highly professional tech team and get rid of antivirus from computer.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:10 AM

    Excellent specialized help for setting up office 365 office.com/setup in your PC or laptop.just call us on our number and we are prepared to give you the best help.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:11 AM

    Introduce norton antivirus with the best help norton.com/setup group and keep your PC infection free.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:11 AM

    Microsoft Office introduce has required the evacuation of the recently introduced rendition of your Office item on the gadget or framework. Office 365 and other membership offers the different highlights, which you don't get when you don't buy the Office item. The workplace can be utilized office setup free, as Microsoft gives the preliminary adaptations of each instrument.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:11 AM

    Download norton antivirus with the best help norton setup group and stay away from infection assaults.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:12 AM

    All around requested guide how to download,install and start your MS Office 365, Office 2016,etc. on any contraption. If you have find any issue in making your Office account, by then visit this site office.com/setup unquestionably causes you.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:12 AM

    norton web security is generally utilized antivirus gives the least demanding to utilize and most intutive assurance for your PC and your mobiles .introduce it and disregard viruses,spyware,root-packs, hackers.Visit: norton.com/setup for more subtleties.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:12 AM

    To enact Hulu Plus on your gadget, either utilize the on-screen console to enter your Hulu sign in data or go to www.hulu.com/activate and enter the gadget initiation code. Both of these strategies will enable you to utilize Hulu on any Hulu-upheld gadget.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:13 AM

    Roku gives the least difficult approach to stream diversion to your TV. On your terms www.roku.com/link With a huge number of accessible channels to browse.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:13 AM

    Start Roku.com/interface, go to roku.com/link account enter Roku com associate code appeared on Roku TV. My roku com interface not working use new Roku code.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:13 AM

    You will get the best solution for the issues related to your version of the Office product. You may also connect us by visiting www.office.com/myaccount us at Check out the easy steps for installing, downloading, activation and re-installing the Microsoft office.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:14 AM

    Inquiry things Included piece from the web AVG AntiVirus.AVG AntiVirus is a gathering of antivirus programming made by AVG Technologies,a reinforcement of Avast. It is available for Windows, macOS and Android avg.com/retail click here for more subtleties.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:14 AM

    Norton is the most dependable antivirus and we are giving you the full help to get norton.com/setup introduced in your workstations and PCs.

  • hardeep01

    hardeep01 September 1st, 2019 @ 03:14 AM

    Office is presently accessible as a one-time buy for business and purchaser clients. Office 2019 is accessible for the two Windows and macOS, and incorporates exemplary variants of Word, Excel, PowerPoint, and Outlook click here office.com/setup for more subtleties.

  • jeni

    jeni February 12th, 2020 @ 01:46 AM

    I want you to thank for your time of this wonderful read!!! I definitely enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!! Ace4sure VMware Certifications

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.

People watching this ticket

Pages