#98 ✓resolved
Jeff Wigal

Can't get TestCase to work

Reported by Jeff Wigal | April 27th, 2009 @ 08:56 PM

I'm having a heck of a time getting my tests working with Authlogic.

I put together a bare-bones rails app up and running, the only plugin I have installed is authlogic.

  • user belongs_to :site
  • site has_many :users
  • account model only has a name:string attribute

I've tried the following variations:

  • Rails 2.2.2, 2.3.2
  • Session- and ActiveRecord-based session store
  • Windows & Linux. My windows box has a very minimal gem setup (just blew it away and started from scratch last week, not related to this problem)
  • within an application with about 12 different plugins and gems, and my app with no other gems/plugins

I'm requiring test_case in my test_helper.rb file

require 'authlogic/test_case'

Here's my integration test

require File.dirname(__FILE__) + '/../test_helper'

class LoginLogoutTest < ActionController::IntegrationTest
  fixtures :all
  setup :activate_authlogic
  # Replace this with your real tests.

  test "can login via post" do
    get new_user_session_path
    post_via_redirect user_session_path, :login => @user.login, :password => "awesomeness"
    logger.info session.inspect
    assert_response :success
    get accounts_path
    logger.info session.inspect
    assert_response :success

  end

  test "can login via create" do
    get new_user_session_path
    UserSession.create!(@user)
    logger.info session.inspect
    get accounts_path
    logger.info session.inspect
    assert_response :success
  end


  def setup
    site = Site.create!(:name => "booberry")
    @user = User.create!(
          :site => site,
          :first_name => "john",
          :last_name => "boy",
          :login => "jeff",
          :email => "jeff@wigaldesign.com",
          :password => "awesomeness", 
          :password_confirmation => "awesomeness")
  end
end

Plugin seems to work great in production/development mode using a browser. What am I missing?

Comments and changes to this ticket

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

Tags

Pages