Forum: Ruby on Rails Unit Testing with authlogic

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Elias O. (Guest)
on 2009-06-04 11:12
(Received via mailing list)
Hi guys,

I am new to the testing world and was trying to test my user model. My
user model has the acts_as_authentic line on it, so a number of things
are added to it.

I added the:

require "authlogic/test_case"

to the test_helper.rb and did this on my user_test.rb. Its just a
simple test to see if check if authlogic is checking that certains e-
mails could be invalid. But my test fails. Can anyone point me up in
the right direction on how to make this test?

require 'test_helper'
class UserTest < ActiveSupport::TestCase
  setup :activate_authlogic

  test "invalid email" do
    user = => 'something')
    assert user.errors.invalid?(:email)

This topic is locked and can not be replied to.