Rails testing authlogic

Posted by pepernik on Stack Overflow See other posts from Stack Overflow or by pepernik
Published on 2010-04-10T16:56:04Z Indexed on 2010/04/10 17:03 UTC
Read the original article Hit count: 251

I just started using tests. I try to test the login like this

require 'test_helper'

class UserFlowsTest < ActionController::IntegrationTest
  fixtures :all

  # Replace this with your real tests.
  test "login and browse" do
    https!
    get "/users/new"
    assert_response :success 
    post "/user_sessions", :email => '[email protected]', :password  => 'aaaa' 
    follow_redirect!
    assert_equal root_path, path 
  end
end

I use authlogic gem in my rails app. What is wrong with this test? It breaks at 'follow_redirect!' saying it is not a redirection but login through a browser works. Thx!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about unit-testing