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!