+ def test_login
+ user = create(:user)
+
+ get login_path
+ assert_response :redirect
+ assert_redirected_to login_path(:cookie_test => true)
+ follow_redirect!
+ assert_response :success
+ assert_template "sessions/new"
+
+ get login_path, :params => { :username => user.display_name, :password => "test" }
+ assert_response :success
+ assert_template "sessions/new"
+
+ post login_path, :params => { :username => user.display_name, :password => "test" }
+ assert_response :redirect
+ assert_redirected_to root_path
+ end
+