Unit Testing with authlogic


#1

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 = User.new(:email => ‘something’)
assert user.errors.invalid?(:email)
end

end